-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(dsl): allow dsl extension by replacing enum for class (#3)
* feat(dsl): allow dsl extension by replacing enum for class
- Loading branch information
1 parent
12a7fa4
commit f4f8141
Showing
21 changed files
with
122 additions
and
141 deletions.
There are no files selected for viewing
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
72 changes: 52 additions & 20 deletions
72
src/main/java/fr/ouestfrance/querydsl/FilterOperation.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,43 +1,75 @@ | ||
package fr.ouestfrance.querydsl; | ||
|
||
import fr.ouestfrance.querydsl.service.validators.ValidatedBy; | ||
import fr.ouestfrance.querydsl.service.validators.impl.CollectionValidator; | ||
import fr.ouestfrance.querydsl.service.validators.impl.ComparableValidator; | ||
import fr.ouestfrance.querydsl.service.validators.impl.StringValidator; | ||
|
||
/** | ||
* Type of operations | ||
* Operations allowed by querydsl | ||
*/ | ||
public enum FilterOperation { | ||
public interface FilterOperation { | ||
|
||
/** | ||
* Should be equals | ||
* Not Equals Operation | ||
*/ | ||
EQ, | ||
@ValidatedBy(ComparableValidator.class) | ||
class NEQ implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should contains data | ||
* Equals Operation | ||
*/ | ||
LIKE, | ||
@ValidatedBy(ComparableValidator.class) | ||
class EQ implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should be greater than | ||
* Greater than Operation | ||
*/ | ||
GT, | ||
@ValidatedBy(ComparableValidator.class) | ||
class GT implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should be greater than or equals to | ||
* Greater than or equals Operation | ||
*/ | ||
GTE, | ||
@ValidatedBy(ComparableValidator.class) | ||
class GTE implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should be less than | ||
* Less than Operation | ||
*/ | ||
LT, | ||
@ValidatedBy(ComparableValidator.class) | ||
class LT implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should be less than or equals to | ||
* Less than or equals Operation | ||
*/ | ||
LTE, | ||
@ValidatedBy(ComparableValidator.class) | ||
class LTE implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should be not equals to | ||
* Like Operation | ||
*/ | ||
NEQ, | ||
@ValidatedBy(StringValidator.class) | ||
class LIKE implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should be in a specific list | ||
* Not Like Operation | ||
*/ | ||
IN, | ||
@ValidatedBy(CollectionValidator.class) | ||
class IN implements FilterOperation { | ||
} | ||
|
||
/** | ||
* Should not be in a specific list | ||
* Not In Operation | ||
*/ | ||
NOT_IN | ||
@ValidatedBy(CollectionValidator.class) | ||
class NOTIN implements FilterOperation { | ||
} | ||
} |
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
5 changes: 1 addition & 4 deletions
5
.../service/validators/impl/InValidator.java → .../validators/impl/CollectionValidator.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
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
24 changes: 0 additions & 24 deletions
24
src/main/java/fr/ouestfrance/querydsl/service/validators/impl/GreaterLessValidator.java
This file was deleted.
Oops, something went wrong.
5 changes: 1 addition & 4 deletions
5
...ervice/validators/impl/LikeValidator.java → ...vice/validators/impl/StringValidator.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
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.