-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
13 changed files
with
244 additions
and
21 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
5 changes: 5 additions & 0 deletions
5
querydsl-postgrest-resttemplate-adapter/src/test/resources/count_response.json
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,5 @@ | ||
[ | ||
{ | ||
"count": 300 | ||
} | ||
] |
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: 5 additions & 0 deletions
5
querydsl-postgrest-webclient-adapter/src/test/resources/count_response.json
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,5 @@ | ||
[ | ||
{ | ||
"count": 300 | ||
} | ||
] |
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
19 changes: 19 additions & 0 deletions
19
querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/CountItem.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,19 @@ | ||
package fr.ouestfrance.querydsl.postgrest.model; | ||
|
||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
import lombok.Setter; | ||
|
||
import java.util.HashMap; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
public class CountItem extends HashMap<String, String> { | ||
|
||
public static CountItem of(int count) { | ||
CountItem countItem = new CountItem(); | ||
countItem.put("count", String.valueOf(count)); | ||
return countItem; | ||
} | ||
} |
44 changes: 44 additions & 0 deletions
44
...dsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.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,44 @@ | ||
package fr.ouestfrance.querydsl.postgrest.model.impl; | ||
|
||
import fr.ouestfrance.querydsl.postgrest.builders.FilterVisitor; | ||
import fr.ouestfrance.querydsl.postgrest.builders.QueryFilterVisitor; | ||
import fr.ouestfrance.querydsl.postgrest.model.Filter; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* Select filter allow to describe a selection | ||
*/ | ||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
public class CountFilter implements Filter, FilterVisitor { | ||
|
||
/** | ||
* Default query param key for selection | ||
*/ | ||
private static final String KEY_PARAMETER = "select"; | ||
|
||
/** | ||
* Create select filter from embedded resources | ||
* | ||
* @return select filter | ||
*/ | ||
public static Filter of() { | ||
return new CountFilter(); | ||
} | ||
|
||
@Override | ||
public void accept(QueryFilterVisitor visitor) { | ||
visitor.visit(this); | ||
} | ||
|
||
@Override | ||
public String getKey() { | ||
return KEY_PARAMETER; | ||
} | ||
|
||
public String getMethod() { | ||
return "count()"; | ||
} | ||
} |
Oops, something went wrong.