-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cc31971
commit aae7d5b
Showing
9 changed files
with
530 additions
and
40 deletions.
There are no files selected for viewing
51 changes: 49 additions & 2 deletions
51
...ndow-pagination/src/main/java/com/example/keysetpagination/model/query/QueryOperator.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,66 @@ | ||
package com.example.keysetpagination.model.query; | ||
|
||
/** | ||
* Represents the supported operators for dynamic query specifications. | ||
* These operators are used to build dynamic JPA queries through specifications. | ||
*/ | ||
public enum QueryOperator { | ||
|
||
// Comparison Operators | ||
/** Equal to */ | ||
EQ, | ||
/** Not equal to */ | ||
NE, | ||
/** Less than */ | ||
LT, | ||
/** Greater than */ | ||
GT, | ||
/** Greater than or equal to */ | ||
GTE, | ||
/** Less than or equal to */ | ||
LTE, | ||
/** Between two values (inclusive) */ | ||
BETWEEN, | ||
/** Is null check */ | ||
IS_NULL, | ||
/** Is not null check */ | ||
IS_NOT_NULL, | ||
|
||
// Collection Operators | ||
/** In a collection of values */ | ||
IN, | ||
/** Not in a collection of values */ | ||
NOT_IN, | ||
|
||
// String Operators | ||
/** SQL LIKE operation */ | ||
LIKE, | ||
/** Contains substring */ | ||
CONTAINS, | ||
/** Starts with prefix */ | ||
STARTS_WITH, | ||
/** Ends with suffix */ | ||
ENDS_WITH, | ||
|
||
// Logical Operators | ||
/** Logical AND */ | ||
AND, | ||
OR, | ||
NOTIN | ||
/** Logical OR */ | ||
OR; | ||
|
||
/** | ||
* Checks if the operator is applicable to string fields. | ||
* @return true if the operator can be used with strings | ||
*/ | ||
public boolean isStringOperator() { | ||
return this == LIKE || this == CONTAINS || this == STARTS_WITH || this == ENDS_WITH; | ||
} | ||
|
||
/** | ||
* Checks if the operator is a logical operator. | ||
* @return true if the operator is logical (AND, OR) | ||
*/ | ||
public boolean isLogicalOperator() { | ||
return this == AND || this == OR; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.