@Component public final class SearchRestrictions extends Object
SearchCriterion
.Modifier and Type | Class and Description |
---|---|
static class |
SearchRestrictions.SearchMatchMode
Match mode for "like" criterion.
|
Constructor and Description |
---|
SearchRestrictions() |
Modifier and Type | Method and Description |
---|---|
static SearchCriterion |
allEq(Map<String,Object> values)
Creates criterion which checks if all given fields match given values.
|
static SearchCriterion |
and(SearchCriterion firstCriterion,
SearchCriterion secondCriterion,
SearchCriterion... otherCriteria)
Creates restriction which join given restrictions with "AND" operator.
|
static SearchCriterion |
belongsTo(String field,
DataDefinition dataDefinition,
long id)
Creates criterion which checks if "belongsTo" field is equal to given entity.
|
static SearchCriterion |
belongsTo(String field,
Entity entity)
Creates criterion which checks if "belongsTo" field is equal to given entity.
|
static SearchCriterion |
belongsTo(String field,
String pluginIdentifier,
String modelName,
long id)
Creates criterion which checks if "belongsTo" field is equal to given entity.
|
static SearchCriterion |
between(String field,
Object lo,
Object hi)
Creates criterion which checks if field is between given values.
|
static SearchConjunction |
conjunction()
Creates conjunction - (...
|
static SearchDisjunction |
disjunction()
Creates disjunction - (...
|
static SearchCriterion |
eq(String field,
Object value)
Creates criterion which checks if field is equal to given value.
|
static SearchCriterion |
eqField(String field,
String otherField)
Creates criterion which checks if field is equal to other field.
|
static SearchCriterion |
ge(String field,
Object value)
Creates criterion which checks if field is greater than or equal to given value.
|
static SearchCriterion |
geField(String field,
String otherField)
Creates criterion which checks if field is greater than or equal to other field.
|
static SearchCriterion |
gt(String field,
Object value)
Creates criterion which checks if field is greater than given value.
|
static SearchCriterion |
gtField(String field,
String otherField)
Creates criterion which checks if field is greater than other field.
|
static SearchCriterion |
idEq(long value)
Creates criterion which checks if id is equal to given value.
|
static SearchCriterion |
idNe(long value)
Creates criterion which checks if id isn't equal to given value.
|
static SearchCriterion |
iEq(String field,
Object value)
Creates criterion which checks if field is equal (using case-insensitive "eq" operator) to given value.
|
static SearchCriterion |
ilike(String field,
String value)
Creates criterion which checks if field is equal (using case-insensitive "like" operator) to given value.
|
static SearchCriterion |
ilike(String field,
String value,
SearchRestrictions.SearchMatchMode mode)
Creates criterion which checks if field is equal (using case-insensitive "like" operator) to given value.
|
static SearchCriterion |
in(String field,
Collection<?> values)
Creates criterion which checks if field is in given values.
|
static SearchCriterion |
in(String field,
Object... values)
Creates criterion which checks if field is in given values.
|
static SearchCriterion |
inIgnoringCase(String field,
Collection<?> values)
Creates criterion which checks if field is in given values ignoring case.
|
static SearchCriterion |
isEmpty(String field)
Creates criterion which checks if "collection" field's size is empty.
|
static SearchCriterion |
isNotEmpty(String field)
Creates criterion which checks if "collection" field's size isn't empty.
|
static SearchCriterion |
isNotNull(String field)
Creates criterion which checks if field is not null.
|
static SearchCriterion |
isNull(String field)
Creates criterion which checks if field is null.
|
static SearchCriterion |
le(String field,
Object value)
Creates criterion which checks if field is less than or equal to given value.
|
static SearchCriterion |
leField(String field,
String otherField)
Creates criterion which checks if field is less than or equal to other field.
|
static SearchCriterion |
like(String field,
String value)
Creates criterion which checks if field is equal (using "like" operator) to given value.
|
static SearchCriterion |
like(String field,
String value,
SearchRestrictions.SearchMatchMode mode)
Creates criterion which checks if field is equal (using "like" operator) to given value.
|
static SearchCriterion |
lt(String field,
Object value)
Creates criterion which checks if field is less than given value.
|
static SearchCriterion |
ltField(String field,
String otherField)
Creates criterion which checks if field is less than other field.
|
static SearchCriterion |
ne(String field,
Object value)
Creates criterion which checks if field isn't equal to given value.
|
static SearchCriterion |
neField(String field,
String otherField)
Creates criterion which checks if field isn't equal to other field.
|
static SearchCriterion |
not(SearchCriterion criterion)
Wraps given criterion with "not" criterion.
|
static SearchCriterion |
or(SearchCriterion firstCriterion,
SearchCriterion secondCriterion,
SearchCriterion... otherCriteria)
Creates restriction which join given restrictions with "OR" operator.
|
static SearchCriterion |
sizeEq(String field,
int size)
Creates criterion which checks if "collection" field's size is equal to given size.
|
static SearchCriterion |
sizeGe(String field,
int size)
Creates criterion which checks if "collection" field's size is greater than or equal to given size.
|
static SearchCriterion |
sizeGt(String field,
int size)
Creates criterion which checks if "collection" field's size is greater than given size.
|
static SearchCriterion |
sizeLe(String field,
int size)
Creates criterion which checks if "collection" field's size is less than or equal to given size.
|
static SearchCriterion |
sizeLt(String field,
int size)
Creates criterion which checks if "collection" field's size is less than given size.
|
static SearchCriterion |
sizeNe(String field,
int size)
Creates criterion which checks if "collection" field's size isn't equal to given size.
|
public static SearchCriterion allEq(Map<String,Object> values)
values
- map where key is a field's name and value is the expected valuepublic static SearchCriterion and(SearchCriterion firstCriterion, SearchCriterion secondCriterion, SearchCriterion... otherCriteria)
firstCriterion
- first criterionsecondCriterion
- second criterionotherCriteria
- other criteriapublic static SearchCriterion belongsTo(String field, DataDefinition dataDefinition, long id)
field
- fielddataDefinition
- data's definitionid
- idpublic static SearchCriterion belongsTo(String field, Entity entity)
field
- fieldentity
- entitypublic static SearchCriterion belongsTo(String field, String pluginIdentifier, String modelName, long id)
field
- fieldpluginIdentifier
- plugin's identifiermodelName
- model's nameid
- idpublic static SearchCriterion between(String field, Object lo, Object hi)
field
- fieldlo
- low valuehi
- high valuepublic static SearchConjunction conjunction()
public static SearchDisjunction disjunction()
public static SearchCriterion eq(String field, Object value)
field
- fieldvalue
- valuepublic static SearchCriterion eqField(String field, String otherField)
field
- fieldotherField
- other fieldpublic static SearchCriterion ge(String field, Object value)
field
- fieldvalue
- valuepublic static SearchCriterion geField(String field, String otherField)
field
- fieldotherField
- other fieldpublic static SearchCriterion gt(String field, Object value)
field
- fieldvalue
- valuepublic static SearchCriterion gtField(String field, String otherField)
field
- fieldotherField
- other fieldpublic static SearchCriterion idEq(long value)
value
- valuepublic static SearchCriterion idNe(long value)
value
- valuepublic static SearchCriterion iEq(String field, Object value)
field
- fieldvalue
- valuepublic static SearchCriterion ilike(String field, String value)
field
- fieldvalue
- valuepublic static SearchCriterion ilike(String field, String value, SearchRestrictions.SearchMatchMode mode)
field
- fieldmode
- match modevalue
- valuepublic static SearchCriterion in(String field, Collection<?> values)
field
- fieldvalues
- valuespublic static SearchCriterion in(String field, Object... values)
field
- fieldvalues
- valuespublic static SearchCriterion inIgnoringCase(String field, Collection<?> values)
field
- fieldvalues
- valuespublic static SearchCriterion isEmpty(String field)
field
- fieldpublic static SearchCriterion isNotEmpty(String field)
field
- fieldpublic static SearchCriterion isNotNull(String field)
field
- fieldpublic static SearchCriterion isNull(String field)
field
- fieldpublic static SearchCriterion le(String field, Object value)
field
- fieldvalue
- valuepublic static SearchCriterion leField(String field, String otherField)
field
- fieldotherField
- other fieldpublic static SearchCriterion like(String field, String value)
field
- fieldvalue
- valuepublic static SearchCriterion like(String field, String value, SearchRestrictions.SearchMatchMode mode)
field
- fieldmode
- match modevalue
- valuepublic static SearchCriterion lt(String field, Object value)
field
- fieldvalue
- valuepublic static SearchCriterion ltField(String field, String otherField)
field
- fieldotherField
- other fieldpublic static SearchCriterion ne(String field, Object value)
field
- fieldvalue
- valuepublic static SearchCriterion neField(String field, String otherField)
field
- fieldotherField
- other fieldpublic static SearchCriterion not(SearchCriterion criterion)
criterion
- criterionpublic static SearchCriterion or(SearchCriterion firstCriterion, SearchCriterion secondCriterion, SearchCriterion... otherCriteria)
firstCriterion
- first criterionsecondCriterion
- second criterionotherCriteria
- other criteriapublic static SearchCriterion sizeEq(String field, int size)
field
- fieldsize
- sizepublic static SearchCriterion sizeGe(String field, int size)
field
- fieldsize
- sizepublic static SearchCriterion sizeGt(String field, int size)
field
- fieldsize
- sizepublic static SearchCriterion sizeLe(String field, int size)
field
- fieldsize
- sizepublic static SearchCriterion sizeLt(String field, int size)
field
- fieldsize
- sizepublic static SearchCriterion sizeNe(String field, int size)
field
- fieldsize
- sizeCopyright © 2010-2025 Qcadoo Limited