public abstract class FESCriterionGenerator
extends java.lang.Object
| Constructor and Description |
|---|
FESCriterionGenerator(org.hibernate.Criteria criteria,
boolean unsupportedIsTrue,
boolean matchDomainIds,
boolean complexParent)
Creates a new
FESCriterionGenerator. |
| Modifier and Type | Method and Description |
|---|---|
protected java.lang.String |
addAlias(java.lang.String property)
Add a alias for the specified property to the criteria.
|
org.hibernate.criterion.Criterion |
create(org.n52.shetland.ogc.filter.Filter<?> filter)
Create a
Criterion for the supplied Filter. |
protected org.hibernate.criterion.Criterion |
createComparison(org.n52.shetland.ogc.filter.ComparisonFilter filter)
Create a
Criterion for the supplied operator, property and value. |
protected org.hibernate.criterion.Criterion |
createComparison(org.n52.shetland.ogc.filter.ComparisonFilter filter,
java.lang.Object value)
Create a
Criterion for the supplied filter. |
protected abstract org.hibernate.criterion.Criterion |
createDataCriterion(org.hibernate.criterion.Criterion criterion)
Create a
Criterion for a property of the associated data entity. |
protected abstract org.hibernate.criterion.Criterion |
createDatasetCriterion(java.lang.String property,
org.n52.shetland.ogc.filter.ComparisonFilter filter)
Create a
Criterion for a property of the associated data set. |
protected abstract org.hibernate.criterion.Criterion |
createDatasetCriterion(java.lang.String property,
org.n52.shetland.ogc.filter.SpatialFilter filter)
Create a
Criterion for a property of the associated data set. |
protected abstract org.hibernate.criterion.Criterion |
createResultCriterion(org.n52.shetland.ogc.filter.ComparisonFilter filter)
Create a
Criterion for the specified result filter. |
protected org.hibernate.criterion.Criterion |
createSpatialFilterCriterion(org.n52.shetland.ogc.filter.SpatialFilter filter)
Create a spatial filter criterion for the supplied filter.
|
protected org.hibernate.Criteria |
getCriteria()
Get the criteria this generator creates criterions for.
|
protected java.util.stream.Stream<org.hibernate.criterion.DetachedCriteria> |
getResultSubqueries(org.n52.shetland.ogc.filter.ComparisonFilter filter)
Create a stream of subqueries that apply the comparison filter to the result value of the data entity.
|
protected boolean |
isComplexParent()
If the queries should result in the parent observation and hide the child observations.
|
protected boolean |
isMatchDomainIds()
Ff filter on observation parameters like feature, offering or procedure should match on their
respective domain
identifiers or on the primary keys in the database
|
protected boolean |
isUnsupportedIsTrue()
If the generator encounters a filter expression it could not translate it may generate a criterion that
is always
true or always false depending on this flag |
static java.util.Optional<java.lang.Boolean> |
parseBoolean(java.lang.String value)
Trys to parse
value as a boolean. |
static java.util.Optional<java.lang.Double> |
parseDouble(java.lang.String value)
Trys to parse
value as a double. |
static java.util.Optional<java.lang.Integer> |
parseInt(java.lang.String value)
Trys to parse
value as a int. |
static java.util.Optional<java.lang.Long> |
parseLong(java.lang.String value)
Trys to parse
value as a long. |
static org.n52.shetland.ogc.gml.time.Time |
parseTime(java.lang.String value)
Parse the
value either as a TimeInstant or as a TimePeriod. |
protected org.hibernate.criterion.Criterion |
unparsableTime(java.lang.String value,
java.lang.IllegalArgumentException ex)
Creates a criterion for an unparsable date time value.
|
protected org.hibernate.criterion.Criterion |
unsupported(java.lang.Enum<?> filter)
Creates a criterion for an unsupported filter.
|
protected org.hibernate.criterion.Criterion |
unsupported(org.n52.shetland.ogc.filter.Filter<?> filter)
Creates a criterion for an unsupported filter.
|
protected org.hibernate.criterion.Criterion |
unsupported(java.lang.Object o)
Creates a criterion for an unsupported filter.
|
public FESCriterionGenerator(org.hibernate.Criteria criteria,
boolean unsupportedIsTrue,
boolean matchDomainIds,
boolean complexParent)
FESCriterionGenerator.criteria - the criteriaunsupportedIsTrue - if the generator encounters a filter expression it could not translate it may generate a
criterion that is always true or always false depending on this flagmatchDomainIds - if filter on observation parameters like feature, offering or procedure should match on
their respective domain identifiers or on the primary keys in the databasecomplexParent - if the queries should result in the parent observation and hide the child observationsprotected org.hibernate.Criteria getCriteria()
protected boolean isUnsupportedIsTrue()
true or always false depending on this flagprotected boolean isMatchDomainIds()
protected boolean isComplexParent()
protected java.lang.String addAlias(java.lang.String property)
property - the propertypublic org.hibernate.criterion.Criterion create(org.n52.shetland.ogc.filter.Filter<?> filter)
Criterion for the supplied Filter.filter - the filterprotected org.hibernate.criterion.Criterion createSpatialFilterCriterion(org.n52.shetland.ogc.filter.SpatialFilter filter)
filter - the filterprotected org.hibernate.criterion.Criterion createComparison(org.n52.shetland.ogc.filter.ComparisonFilter filter)
Criterion for the supplied operator, property and value.filter - the filterprotected org.hibernate.criterion.Criterion createComparison(org.n52.shetland.ogc.filter.ComparisonFilter filter,
java.lang.Object value)
Criterion for the supplied filter. value may hold a typed value to be used instead of
the filter's string value.filter - the filtervalue - a optional object to be used instead of the filter's string valueprotected org.hibernate.criterion.Criterion unsupported(org.n52.shetland.ogc.filter.Filter<?> filter)
filter - the filterprotected org.hibernate.criterion.Criterion unsupported(java.lang.Enum<?> filter)
filter - the filterprotected org.hibernate.criterion.Criterion unsupported(java.lang.Object o)
o - the unsupported objectprotected org.hibernate.criterion.Criterion unparsableTime(java.lang.String value,
java.lang.IllegalArgumentException ex)
value - the valueex - the causing exceptionprotected java.util.stream.Stream<org.hibernate.criterion.DetachedCriteria> getResultSubqueries(org.n52.shetland.ogc.filter.ComparisonFilter filter)
filter - the filterprotected abstract org.hibernate.criterion.Criterion createResultCriterion(org.n52.shetland.ogc.filter.ComparisonFilter filter)
Criterion for the specified result filter.filter - the filterprotected abstract org.hibernate.criterion.Criterion createDatasetCriterion(java.lang.String property,
org.n52.shetland.ogc.filter.ComparisonFilter filter)
Criterion for a property of the associated data set.property - the property of the data set to apply the filter tofilter - the comparison filterprotected abstract org.hibernate.criterion.Criterion createDatasetCriterion(java.lang.String property,
org.n52.shetland.ogc.filter.SpatialFilter filter)
Criterion for a property of the associated data set.property - the property of the data set to apply the filter tofilter - the spatial filterprotected abstract org.hibernate.criterion.Criterion createDataCriterion(org.hibernate.criterion.Criterion criterion)
Criterion for a property of the associated data entity.criterion - the criterionpublic static org.n52.shetland.ogc.gml.time.Time parseTime(java.lang.String value)
throws java.lang.IllegalArgumentException
value either as a TimeInstant or as a TimePeriod.value - the string valuejava.lang.IllegalArgumentException - if the value does not represent a valud time instant or periodpublic static java.util.Optional<java.lang.Long> parseLong(java.lang.String value)
value as a long.value - the valueOptional.empty()public static java.util.Optional<java.lang.Integer> parseInt(java.lang.String value)
value as a int.value - the valueOptional.empty()public static java.util.Optional<java.lang.Double> parseDouble(java.lang.String value)
value as a double.value - the valueOptional.empty()public static java.util.Optional<java.lang.Boolean> parseBoolean(java.lang.String value)
value as a boolean.value - the valueOptional.empty()Copyright © 2015–2018 52°North Initiative for Geospatial Open Source Software GmbH. All rights reserved.