-
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.
Merge pull request #2 from Ouest-France/1-improve-querydsl-to-allow-l…
…ogical-operand feat(logical-operators): add logical operators on single and multiple…
- Loading branch information
Showing
22 changed files
with
445 additions
and
181 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Check Feature | ||
|
||
on: | ||
push: | ||
branches-ignore: [ main ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-java@v3 | ||
with: | ||
java-version: '17' | ||
distribution: 'temurin' | ||
cache: maven | ||
- name: Build | ||
run: mvn -ntp -B package --file pom.xml |
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
15 changes: 15 additions & 0 deletions
15
src/main/java/fr/ouestfrance/querydsl/model/FieldMetadata.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 |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package fr.ouestfrance.querydsl.model; | ||
|
||
import java.lang.reflect.Method; | ||
import java.lang.reflect.Type; | ||
|
||
/** | ||
* FieldInformation class represent metadata on declared field in a class | ||
* | ||
* @param name Name of the field | ||
* @param type Return declared type of the field | ||
* @param getter Getter method to access data | ||
*/ | ||
public record FieldMetadata(String name, Type type, Method getter) { | ||
|
||
} |
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package fr.ouestfrance.querydsl.model; | ||
|
||
/** | ||
* Filter interface | ||
* The filter can be SimpleFilter or GroupFilter | ||
*/ | ||
public interface Filter { | ||
} |
26 changes: 0 additions & 26 deletions
26
src/main/java/fr/ouestfrance/querydsl/model/FilterFieldInfoModel.java
This file was deleted.
Oops, something went wrong.
35 changes: 0 additions & 35 deletions
35
src/main/java/fr/ouestfrance/querydsl/model/FilterFieldModel.java
This file was deleted.
Oops, something went wrong.
26 changes: 26 additions & 0 deletions
26
src/main/java/fr/ouestfrance/querydsl/model/GroupFilter.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 |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package fr.ouestfrance.querydsl.model; | ||
|
||
import java.util.List; | ||
|
||
/** | ||
* Group filter allow to create a filter with logical operand and sub filters | ||
* @param name of the group | ||
* @param filters list of filters in the group | ||
* @param operand logical operator to apply | ||
*/ | ||
public record GroupFilter(String name, List<Filter> filters, Operand operand) implements Filter { | ||
|
||
/** | ||
* Operand types | ||
*/ | ||
public enum Operand { | ||
/** | ||
* OR Operand | ||
*/ | ||
OR, | ||
/** | ||
* AND Operand | ||
*/ | ||
AND | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/main/java/fr/ouestfrance/querydsl/model/SimpleFilter.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 |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package fr.ouestfrance.querydsl.model; | ||
|
||
import fr.ouestfrance.querydsl.FilterOperation; | ||
|
||
/** | ||
* FilterFieldInfoModel allow to store object representation of FilterField Annotation | ||
* @param key key of the criteria | ||
* @param operation operator to apply | ||
* @param orNull allow the field to be null | ||
* @param metadata metadata of the field representing type, method accessor and field name | ||
*/ | ||
public record SimpleFilter(String key, FilterOperation operation, boolean orNull, | ||
FieldMetadata metadata) implements Filter { | ||
} |
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.