-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ | ||
{ | ||
"count": 300 | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[ | ||
{ | ||
"count": 300 | ||
} | ||
] |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package fr.ouestfrance.querydsl.postgrest.model; | ||
|
||
import lombok.*; | ||
|
||
import java.util.HashMap; | ||
|
||
@Getter | ||
@Setter | ||
@NoArgsConstructor | ||
Check warning on line 9 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/CountItem.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/CountItem.java#L9
|
||
@EqualsAndHashCode(callSuper = false) | ||
public class CountItem extends HashMap<String, String> { | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
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.AllArgsConstructor; | ||
import lombok.Getter; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
/** | ||
* Select filter allow to describe a selection | ||
*/ | ||
@Getter | ||
@RequiredArgsConstructor(access = AccessLevel.PRIVATE) | ||
@AllArgsConstructor(access = AccessLevel.PRIVATE) | ||
Check warning on line 16 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L16
|
||
public class CountFilter implements Filter, FilterVisitor { | ||
|
||
/** | ||
* Default query param key for selection | ||
*/ | ||
private static final String KEY_PARAMETER = "select"; | ||
/** | ||
* list of fields | ||
*/ | ||
private String groupBy; | ||
Check warning on line 26 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L26
|
||
|
||
|
||
/** | ||
* Create select filter from embedded resources | ||
* @return select filter | ||
*/ | ||
public static Filter groupBy(String field) { | ||
return new CountFilter(field); | ||
Check warning on line 34 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L34
|
||
} | ||
|
||
/** | ||
* Create select filter from embedded resources | ||
* | ||
* @return select filter | ||
*/ | ||
public static Filter of() { | ||
return new CountFilter(); | ||
Check warning on line 43 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L43
|
||
} | ||
|
||
@Override | ||
public void accept(QueryFilterVisitor visitor) { | ||
visitor.visit(this); | ||
} | ||
Check warning on line 49 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L48-L49
|
||
|
||
@Override | ||
public String getKey() { | ||
return KEY_PARAMETER; | ||
Check warning on line 53 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L53
|
||
} | ||
|
||
|
||
/** | ||
* Attribute name | ||
*/ | ||
@Getter | ||
@RequiredArgsConstructor | ||
Check warning on line 61 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L61
|
||
public static class Attribute { | ||
/** | ||
* alias | ||
*/ | ||
private final String alias; | ||
Check warning on line 66 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L66
|
||
/** | ||
* value selected | ||
*/ | ||
private final String value; | ||
Check warning on line 70 in querydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java Codecov / codecov/patchquerydsl-postgrest/src/main/java/fr/ouestfrance/querydsl/postgrest/model/impl/CountFilter.java#L70
|
||
|
||
} | ||
} |