Base fluent builder for Hibernate criteria restrictions, exposed to JS as the chainable methods available on a query and on its AND/OR sub-blocks. Subclasses supply where each restriction is added: KCriteria adds it directly to the underlying Hibernate criteria, JunctionCriteriaBuilder adds it to a nested conjunction or disjunction. Every method returns a builder so calls can be chained to compose a query.
Group: Builders
Methods
likeStartsWith(String propertyName, Object value) · likeAnywhere(String propertyName, Object value) · ilikeAnywhere(String propertyName, Object value) · ilikeStartsWith(String propertyName, Object value) · ilike(String propertyName, Object value) · eq(String propertyName, Object value) · ne(String propertyName, Object value) · ge(String propertyName, Object value) · gt(String propertyName, Object value) · le(String propertyName, Object value) · lt(String propertyName, Object value) · isNull(String propertyName) · isNotNull(String propertyName) · in(String propertyName, Collection value) · in(String propertyName, Object[] value) · nin(String propertyName, Object[] value) · nin(String propertyName, Collection value) · conjunction() · disjunction()
likeStartsWith(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a case-sensitive "starts with" restriction, matching values of the property that begin with the given value.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the value to match at the start of the property; converted to a string before matching |
likeAnywhere(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a case-sensitive "contains" restriction, matching values of the property that contain the given value anywhere in the string.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the value to search for within the property; converted to a string before matching |
ilikeAnywhere(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a case-insensitive "contains" restriction, matching values of the property that contain the given value anywhere in the string, regardless of case.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the value to search for within the property; converted to a string before matching |
ilikeStartsWith(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a case-insensitive "starts with" restriction, matching values of the property that begin with the given value, regardless of case.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the value to match at the start of the property; converted to a string before matching |
ilike(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a case-insensitive equality-style "like" restriction, similar to the Postgres ilike operator. Unlike ilikeAnywhere, no wildcard is implied around the value, so it behaves as a case-insensitive equality match unless the caller includes their own wildcard characters in the value.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the value to match against the property; converted to a string before matching |
eq(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds an equality restriction on the named property. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the value the property must equal |
ne(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a not-equal restriction on the named property. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the value the property must not equal |
ge(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a "greater than or equal to" restriction on the named property. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the lower bound the property must meet or exceed |
gt(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a "greater than" restriction on the named property. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the lower bound the property must exceed |
le(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a "less than or equal to" restriction on the named property. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the upper bound the property must meet or fall below |
lt(String propertyName, Object value)
Returns: BaseCriteriaBuilder
Adds a "less than" restriction on the named property. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the upper bound the property must fall below |
isNull(String propertyName)
Returns: BaseCriteriaBuilder
Adds a restriction that the named property must be null.
| Parameter | Description |
|---|---|
propertyName | the name of the property to check |
isNotNull(String propertyName)
Returns: BaseCriteriaBuilder
Adds a restriction that the named property must not be null.
| Parameter | Description |
|---|---|
propertyName | the name of the property to check |
in(String propertyName, Collection value)
Returns: BaseCriteriaBuilder
Adds a restriction that the named property must equal one of the values in the given collection. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the collection of allowed values; must not be null |
in(String propertyName, Object[] value)
Returns: BaseCriteriaBuilder
Adds a restriction that the named property must equal one of the values in the given array. Integer values are widened to Long first, because identifier properties are stored as Long and JS numeric values otherwise arrive as Integer.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the array of allowed values; must not be null |
nin(String propertyName, Object[] value)
Returns: BaseCriteriaBuilder
Adds a restriction that the named property must not equal any of the values in the given array.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the array of disallowed values |
nin(String propertyName, Collection value)
Returns: BaseCriteriaBuilder
Adds a restriction that the named property must not equal any of the values in the given collection.
| Parameter | Description |
|---|---|
propertyName | the name of the property to match on |
value | the collection of disallowed values |
conjunction()
Returns: JunctionCriteriaBuilder
Starts a nested AND block: restrictions added to the returned builder are combined with each other using AND, and the whole block is added as a single restriction to this builder.
disjunction()
Returns: JunctionCriteriaBuilder
Starts a nested OR block: restrictions added to the returned builder are combined with each other using OR, and the whole block is added as a single restriction to this builder.