-
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
- Loading branch information
1 parent
5300eb3
commit 6d86f45
Showing
21 changed files
with
112 additions
and
159 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
82 changes: 42 additions & 40 deletions
82
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,45 @@ | ||
package fr.ouestfrance.querydsl; | ||
|
||
/** | ||
* Type of operations | ||
*/ | ||
public enum FilterOperation { | ||
/** | ||
* Should be equals | ||
*/ | ||
EQ, | ||
/** | ||
* Should contains data | ||
*/ | ||
LIKE, | ||
/** | ||
* Should be greater than | ||
*/ | ||
GT, | ||
/** | ||
* Should be greater than or equals to | ||
*/ | ||
GTE, | ||
/** | ||
* Should be less than | ||
*/ | ||
LT, | ||
/** | ||
* Should be less than or equals to | ||
*/ | ||
LTE, | ||
/** | ||
* Should be not equals to | ||
*/ | ||
NEQ, | ||
/** | ||
* Should be in a specific list | ||
*/ | ||
IN, | ||
/** | ||
* Should not be in a specific list | ||
*/ | ||
NOT_IN | ||
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; | ||
|
||
public interface FilterOperation { | ||
|
||
@ValidatedBy(ComparableValidator.class) | ||
class NEQ implements FilterOperation { | ||
} | ||
|
||
@ValidatedBy(ComparableValidator.class) | ||
class EQ implements FilterOperation { | ||
} | ||
|
||
@ValidatedBy(ComparableValidator.class) | ||
class GT implements FilterOperation { | ||
} | ||
|
||
@ValidatedBy(ComparableValidator.class) | ||
class GTE implements FilterOperation { | ||
} | ||
|
||
@ValidatedBy(ComparableValidator.class) | ||
class LT implements FilterOperation { | ||
} | ||
|
||
@ValidatedBy(ComparableValidator.class) | ||
class LTE implements FilterOperation { | ||
} | ||
|
||
@ValidatedBy(StringValidator.class) | ||
class LIKE implements FilterOperation { | ||
} | ||
|
||
@ValidatedBy(CollectionValidator.class) | ||
class IN implements FilterOperation { | ||
} | ||
|
||
@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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,5 +17,5 @@ | |
* | ||
* @return operation | ||
*/ | ||
FilterOperation[] value(); | ||
Class<? extends FilterFieldValidator> value(); | ||
} |
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
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.