public class SQLFilterFactory extends FilterFactory<SQLConstraint>
SmartQuery
.OMA.FILTERS
Constructor and Description |
---|
SQLFilterFactory() |
Modifier and Type | Method and Description |
---|---|
protected Object |
customTransform(Object value)
Permits to provive database dependent transformations.
|
protected SQLConstraint |
effectiveAnd(List<SQLConstraint> effectiveConstraints)
Combines the list of constraints using AND
|
protected SQLConstraint |
effectiveOr(List<SQLConstraint> effectiveConstraints)
Combines the list of constraints using OR
|
protected SQLConstraint |
eqValue(Mapping field,
Object value)
Represents field = value as constraint
|
Exists |
existsIn(Mapping outerColumn,
Class<? extends SQLEntity> other,
Mapping innerColumn)
Generates an EXISTS clause: EXISTS(SELECT * FROM other WHERE e.outerColumn = other.innerColumn.
|
SQLConstraint |
filled(Mapping field)
Generates a constraint which ensures that the given field is filled (not null)
|
protected SQLConstraint |
gtValue(Mapping field,
Object value,
boolean orEqual)
Represents field > value as constraint
|
protected SQLConstraint |
invert(SQLConstraint constraint)
Effectively inverts the given constraint
|
Like |
like(Mapping fields)
Creates a LIKE constraint for the given field.
|
protected SQLConstraint |
ltValue(Mapping field,
Object value,
boolean orEqual)
Represents field < value as constraint
|
protected SQLConstraint |
neValue(Mapping field,
Object value)
Represents field !
|
SQLConstraint |
notFilled(Mapping field)
Generates a constraint which ensures that the given field is not filled (null)
|
SQLConstraint |
queryString(EntityDescriptor descriptor,
String query,
List<QueryField> fields)
Compiles the given query for the given entity while searching in the given fields.
|
and, and, containsAll, containsAny, containsNone, containsOne, eq, eqIgnoreEmpty, eqOrEmpty, gt, gte, gteOrEmpty, gtOrEmpty, lt, lte, lteOrEmpty, ltOrEmpty, ne, noneInField, not, oneInField, or, or, queryString, transform
protected Object customTransform(Object value)
FilterFactory
customTransform
in class FilterFactory<SQLConstraint>
value
- the value to tranformprotected SQLConstraint eqValue(Mapping field, Object value)
FilterFactory
eqValue
in class FilterFactory<SQLConstraint>
field
- the field to filtervalue
- the value to filter withprotected SQLConstraint neValue(Mapping field, Object value)
FilterFactory
neValue
in class FilterFactory<SQLConstraint>
field
- the field to filtervalue
- the value to filter withprotected SQLConstraint gtValue(Mapping field, Object value, boolean orEqual)
FilterFactory
gtValue
in class FilterFactory<SQLConstraint>
field
- the field to filtervalue
- the value to filter withorEqual
- if true, field >= value is used as comparatorprotected SQLConstraint ltValue(Mapping field, Object value, boolean orEqual)
FilterFactory
ltValue
in class FilterFactory<SQLConstraint>
field
- the field to filtervalue
- the value to filter withorEqual
- if true, field <= value is used as comparatorpublic SQLConstraint filled(Mapping field)
FilterFactory
filled
in class FilterFactory<SQLConstraint>
field
- the field to checkpublic SQLConstraint notFilled(Mapping field)
FilterFactory
notFilled
in class FilterFactory<SQLConstraint>
field
- the field to checkprotected SQLConstraint invert(SQLConstraint constraint)
FilterFactory
invert
in class FilterFactory<SQLConstraint>
constraint
- the constraint to invertprotected SQLConstraint effectiveAnd(List<SQLConstraint> effectiveConstraints)
FilterFactory
effectiveAnd
in class FilterFactory<SQLConstraint>
effectiveConstraints
- the constraints to combine (where each value will be non-null)protected SQLConstraint effectiveOr(List<SQLConstraint> effectiveConstraints)
FilterFactory
effectiveOr
in class FilterFactory<SQLConstraint>
effectiveConstraints
- the constraints to combine (where each value will be non-null)public SQLConstraint queryString(EntityDescriptor descriptor, String query, List<QueryField> fields)
FilterFactory
queryString
in class FilterFactory<SQLConstraint>
descriptor
- the descriptor of the entity being searchedquery
- the query to compilefields
- the default fields to search inpublic Exists existsIn(Mapping outerColumn, Class<? extends SQLEntity> other, Mapping innerColumn)
outerColumn
- the column of the entities being queried to matchother
- the entity type to search in (which must exist)innerColumn
- the column within that inner entity type which must match the outer columnCopyright © 2018. All rights reserved.