public class QueryCriteriaUtils
Modifier and Type | Field and Description |
---|---|
static int |
DEFAULT_PAGE_NUM
Pagination and Ordering
|
static int |
DEFAULT_PAGE_SIZE |
static int |
MAX_PAGE_SIZE
Note: use
class PageSpecification to correctly handle a number of bounded pages of a pre-configured page size. |
Modifier and Type | Method and Description |
---|---|
static <A> A |
builder(Function1<? super net.corda.core.node.services.vault.Builder,? extends A> block) |
static <O,C> java.lang.String |
getColumnName(Column<O,? extends C> column) |
static FieldInfo |
getField(java.lang.String fieldName,
java.lang.Class<?> entityClass)
Returns a
class FieldInfo for field with name fieldName in entityClass. |
static <O,C> java.lang.Class<O> |
resolveEnclosingObjectFromColumn(Column<O,? extends C> column) |
static <O,R> java.lang.Class<O> |
resolveEnclosingObjectFromExpression(CriteriaExpression<O,? extends R> expression) |
public static int DEFAULT_PAGE_NUM
Pagination and Ordering
Provide simple ability to specify an offset within a result set and the number of results to return from that offset (eg. page size) together with (optional) sorting criteria at column level.
Note: it is the responsibility of the calling client to manage page windows.
For advanced pagination it is recommended you utilise standard JPA query frameworks such as Spring Data's JPARepository which extends the PagingAndSortingRepository interface to provide paging and sorting capability: https://docs.spring.io/spring-data/commons/docs/current/api/org/springframework/data/repository/PagingAndSortingRepository.html
public static int DEFAULT_PAGE_SIZE
public static int MAX_PAGE_SIZE
Note: use class PageSpecification
to correctly handle a number of bounded pages of a pre-configured page size.
class PageSpecification
public static <O,R> java.lang.Class<O> resolveEnclosingObjectFromExpression(CriteriaExpression<O,? extends R> expression)
public static <O,C> java.lang.Class<O> resolveEnclosingObjectFromColumn(Column<O,? extends C> column)
public static <O,C> java.lang.String getColumnName(Column<O,? extends C> column)
public static <A> A builder(Function1<? super net.corda.core.node.services.vault.Builder,? extends A> block)
public static FieldInfo getField(java.lang.String fieldName, java.lang.Class<?> entityClass)
Returns a class FieldInfo
for field with name fieldName in entityClass.
fieldName
- name of the fieldentityClass
- JPA entity class containing the fieldclass FieldInfo