public interface Filter extends BaseFilter
Modifier and Type | Method and Description |
---|---|
Filter |
addAndFilter(BaseFilter filter) |
void |
addBetween(String fieldAttributeName,
Calendar start,
Calendar end,
org.hippoecm.repository.util.DateTools.Resolution resolution)
Adds a FAST DATE RANGE constraint that the Calendar value for
fieldAttributeName is between start and end (boundaries included) BASED ON the
granularity resolution . |
void |
addBetween(String fieldAttributeName,
Object value1,
Object value2)
Adds a constraint that the value
fieldAttributeName is between value1 and value2 (boundaries included). |
void |
addContains(String scope,
String fullTextSearch)
Adds a fulltext search to this Filter.
|
void |
addEqualTo(String fieldAttributeName,
Calendar calendar,
org.hippoecm.repository.util.DateTools.Resolution resolution)
Adds a constraint that the Calendar value for
fieldAttributeName rounded to its resolution is equal to the
rounded value for calendar . |
void |
addEqualTo(String fieldAttributeName,
Object value)
Adds a constraint that the value
fieldAttributeName is equal to value |
void |
addGreaterOrEqualThan(String fieldAttributeName,
Calendar calendar,
org.hippoecm.repository.util.DateTools.Resolution resolution) |
void |
addGreaterOrEqualThan(String fieldAttributeName,
Object value)
Adds a constraint that the value
fieldAttributeName is greater than or equal to value |
void |
addGreaterThan(String fieldAttributeName,
Calendar calendar,
org.hippoecm.repository.util.DateTools.Resolution resolution) |
void |
addGreaterThan(String fieldAttributeName,
Object value)
Adds a constraint that the value
fieldAttributeName is greater than value |
void |
addIsNull(String fieldAttributeName)
Add a constraint that the result does NOT have the property
fieldAttributeName |
void |
addJCRExpression(String jcrExpression)
Adds the xpath
jcrExpression as constraint. |
void |
addLessOrEqualThan(String fieldAttributeName,
Calendar calendar,
org.hippoecm.repository.util.DateTools.Resolution resolution) |
void |
addLessOrEqualThan(String fieldAttributeName,
Object value)
Adds a constraint that the value
fieldAttributeName is less than or equal to value |
void |
addLessThan(String fieldAttributeName,
Calendar calendar,
org.hippoecm.repository.util.DateTools.Resolution resolution) |
void |
addLessThan(String fieldAttributeName,
Object value)
Adds a constraint that the value
fieldAttributeName is less than value |
void |
addLike(String fieldAttributeName,
Object value)
Try to not use this method as it blows up searches.
|
void |
addNotBetween(String fieldAttributeName,
Calendar start,
Calendar end,
org.hippoecm.repository.util.DateTools.Resolution resolution) |
void |
addNotBetween(String fieldAttributeName,
Object value1,
Object value2)
Adds a constraint that the value
fieldAttributeName is NOT between value1 and value2 ,
including NOT value1 and value2 |
void |
addNotContains(String scope,
String fullTextSearch)
The negated version of
addContains(String, String) |
void |
addNotEqualTo(String fieldAttributeName,
Calendar calendar,
org.hippoecm.repository.util.DateTools.Resolution resolution) |
void |
addNotEqualTo(String fieldAttributeName,
Object value)
Adds a constraint that the value
fieldAttributeName is NOT equal to value |
void |
addNotLike(String fieldAttributeName,
Object value)
Try to not use this method as it blows up searches.
|
void |
addNotNull(String fieldAttributeName)
Add a constraint that the result does have the property
fieldAttributeName , regardless its value |
Filter |
addOrFilter(BaseFilter filter) |
Filter |
negate()
negates the current filter
|
getJcrExpression
void addContains(String scope, String fullTextSearch) throws FilterException
scope
. When the
scope
is just a .
, the search will be done on the entire document. When the scope
is
for example @myproject:title
, the free text search is done on this property only. You can also point to properties of
child nodes, for example a scope like myproject:paragraph/@myproject:header
scope
- the scope to search in. scope = "."
means searching in the entire node/document. scope = "example:title"
only
searches in the property "example:title". scope
is also allowed to be a path to a property in a descendant node, for example scope = "address/example:street"
. The
latter is equivalent to scope = "address/@example:street"
fullTextSearch
- the text to search onFilterException
- when scope
or fullTextSearch
is null
void addNotContains(String scope, String fullTextSearch) throws FilterException
addContains(String, String)
scope
- the scope to search in. scope = "."
means searching in the entire node/document. scope = "example:title"
only
searches in the property "example:title". scope
is also allowed to be a path to a property in a descendant node, for example scope = "address/example:street"
. The
latter is equivalent to scope = "address/@example:street"
fullTextSearch
- the text to search onFilterException
- when scope
or fullTextSearch
is null
#addContains(String, String)}
void addBetween(String fieldAttributeName, Object value1, Object value2) throws FilterException
Adds a constraint that the value fieldAttributeName
is between value1
and value2
(boundaries included).
note that for range queries on calendar/date instances where the granularity of, say Day, is enough, you
should use addBetween(String, java.util.Calendar, java.util.Calendar, DateTools.Resolution)
with the highest resolution that is acceptable for your use case, as this performs much better, OR make sure
that your application runs with a default resolution set to for example 'day'
fieldAttributeName
- the name of the attribute, eg "hippo:lastModified"value1
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
value2
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
, value1
or value2
are invalid types/values or one of them is null
void addBetween(String fieldAttributeName, Calendar start, Calendar end, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
fieldAttributeName
is between start
and end
(boundaries included) BASED ON the
granularity resolution
. Thus suppose the Resolution is Resolution.DAY
, then results with the same DAY as value for fieldAttributeName
will be included. The higher the Resolution (year is highest) the better the performance!fieldAttributeName
- the name of the attribute, eg "hippo:lastModified"start
- the date to start from (including)end
- the date to end (including)resolution
- the resolution to use to compare dates. The higher the Resolution (year is highest) the better the performanFilterException
void addNotBetween(String fieldAttributeName, Object value1, Object value2) throws FilterException
Adds a constraint that the value fieldAttributeName
is NOT between value1
and value2
,
including NOT value1
and value2
note that for range queries on calendar/date instances where the granularity of, say Day, is enough, you
should use addNotBetween(String, java.util.Calendar, java.util.Calendar, DateTools.Resolution)
with the highest resolution that is acceptable for your use case, as this performs much better, OR make sure
that your application runs with a default resolution set to for example 'day'
fieldAttributeName
- the name of the attribute, eg "example:date"value1
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
value2
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
, value1
or value2
are invalid types/values or one of them is null
void addNotBetween(String fieldAttributeName, Calendar start, Calendar end, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
FilterException
#addBetween(String, java.util.Calendar, java.util.Calendar, DateTools.Resolution)} but now negated
void addEqualTo(String fieldAttributeName, Object value) throws FilterException
fieldAttributeName
is equal to value
fieldAttributeName
- the name of the attribute, eg "example:author"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addEqualTo(String fieldAttributeName, Calendar calendar, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
fieldAttributeName
rounded to its resolution is equal to the
rounded value for calendar
. Thus assume the Resolution
is equal to Resolution.DAY
,
then all nodes/documents where the property fieldAttributeName
as a Calendar value with the calendar
rounded to days, will match.FilterException
void addNotEqualTo(String fieldAttributeName, Object value) throws FilterException
fieldAttributeName
is NOT equal to value
fieldAttributeName
- the name of the attribute, eg "example:author"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addNotEqualTo(String fieldAttributeName, Calendar calendar, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
FilterException
#addEqualTo(String, java.util.Calendar, DateTools.Resolution)} only now negated
void addGreaterOrEqualThan(String fieldAttributeName, Object value) throws FilterException
Adds a constraint that the value fieldAttributeName
is greater than or equal to value
note that for range queries on calendar/date instances where the granularity of, say Day, is enough, you
should use addGreaterOrEqualThan(String, java.util.Calendar, DateTools.Resolution)
with the highest resolution that is acceptable for your use case, as this performs much better, OR make sure
that your application runs with a default resolution set to for example 'day'
fieldAttributeName
- the name of the attribute, eg "example:date"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addGreaterOrEqualThan(String fieldAttributeName, Calendar calendar, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
FilterException
#addBetween(String, java.util.Calendar, java.util.Calendar, DateTools.Resolution)}
but now no upper bound
void addGreaterThan(String fieldAttributeName, Object value) throws FilterException
Adds a constraint that the value fieldAttributeName
is greater than value
note that for range queries on calendar/date instances where the granularity of, say Day, is enough, you
should use addGreaterThan(String, java.util.Calendar, DateTools.Resolution)
with the highest resolution that is acceptable for your use case, as this performs much better, OR make sure
that your application runs with a default resolution set to for example 'day'
fieldAttributeName
- the name of the attribute, eg "example:date"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addGreaterThan(String fieldAttributeName, Calendar calendar, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
FilterException
#addBetween(String, java.util.Calendar, java.util.Calendar, DateTools.Resolution)}
but now no upper bound and lower bound not included
void addLessOrEqualThan(String fieldAttributeName, Object value) throws FilterException
Adds a constraint that the value fieldAttributeName
is less than or equal to value
note that for range queries on calendar/date instances where the granularity of, say Day, is enough, you
should use addLessOrEqualThan(String, java.util.Calendar, DateTools.Resolution)
with the highest resolution that is acceptable for your use case, as this performs much better, OR make sure
that your application runs with a default resolution set to for example 'day'
fieldAttributeName
- the name of the attribute, eg "example:date"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addLessOrEqualThan(String fieldAttributeName, Calendar calendar, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
FilterException
#addBetween(String, java.util.Calendar, java.util.Calendar, DateTools.Resolution)}
but now no lower bound
void addLessThan(String fieldAttributeName, Object value) throws FilterException
Adds a constraint that the value fieldAttributeName
is less than value
note that for range queries on calendar/date instances where the granularity of, say Day, is enough, you
should use addLessThan(String, java.util.Calendar, DateTools.Resolution)
with the highest resolution that is acceptable for your use case, as this performs much better, OR make sure
that your application runs with a default resolution set to for example 'day'
fieldAttributeName
- the name of the attribute, eg "example:date"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addLessThan(String fieldAttributeName, Calendar calendar, org.hippoecm.repository.util.DateTools.Resolution resolution) throws FilterException
FilterException
#addBetween(String, java.util.Calendar, java.util.Calendar, DateTools.Resolution)}
but now no lower bound and upper bound not included
void addLike(String fieldAttributeName, Object value) throws FilterException
fieldAttributeName
matches *value
* where * is a any patternfieldAttributeName
- the name of the attribute, eg "example:author"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addNotLike(String fieldAttributeName, Object value) throws FilterException
fieldAttributeName
does not match *value
* where * is a any patternfieldAttributeName
- the name of the attribute, eg "example:author"value
- object that must be of type String, Boolean, Long, Double, Calendar
or Date
FilterException
- when fieldAttributeName
or value
is of invalid type/value or is null
void addNotNull(String fieldAttributeName) throws FilterException
fieldAttributeName
, regardless its valuefieldAttributeName
- the name of the attribute, eg "example:author"FilterException
- when fieldAttributeName
is null
void addIsNull(String fieldAttributeName) throws FilterException
fieldAttributeName
fieldAttributeName
- the name of the attribute, eg "example:author"FilterException
- when fieldAttributeName
is null
void addJCRExpression(String jcrExpression)
jcrExpression
as constraint. See jsr-170 spec for the xpath formatjcrExpression
- Filter addOrFilter(BaseFilter filter)
filter
- to OR addedFilter addAndFilter(BaseFilter filter)
filter
- to AND addedFilter negate()
Copyright © 2008-2013 Hippo B.V. (http://www.onehippo.com). All Rights Reserved.