public abstract class SingleEntityQueryRendererDelegate<Q,R> extends Object implements QueryRendererDelegate<R>
QueryBuilder
could do this.Modifier and Type | Class and Description |
---|---|
protected static class |
SingleEntityQueryRendererDelegate.Status
States which this object can have during tree walking
|
Modifier and Type | Field and Description |
---|---|
protected AggregationPropertyPath.Type |
aggregationType |
protected String |
alias |
protected Map<String,String> |
aliasToEntityType
Persister space: keep track of aliases and entity names.
|
protected Map<String,PropertyPath> |
aliasToPropertyPath |
protected SingleEntityQueryBuilder<Q> |
builder |
protected List<String> |
projections |
protected PropertyPath |
propertyPath |
protected static String |
SORT_ASC_SPEC |
protected SingleEntityQueryRendererDelegate.Status |
status
The current status
|
protected Class<?> |
targetType |
protected String |
targetTypeName |
Constructor and Description |
---|
SingleEntityQueryRendererDelegate(PropertyHelper propertyHelper,
EntityNamesResolver entityNames,
SingleEntityQueryBuilder<Q> builder,
Map<String,Object> namedParameters) |
Modifier and Type | Method and Description |
---|---|
void |
activateAggregation(AggregationPropertyPath.Type aggregationType) |
void |
activateAND() |
void |
activateNOT() |
void |
activateOR() |
protected void |
addGrouping(PropertyPath propertyPath,
String collateName)
Add 'group by' criteria.
|
protected void |
addSortField(PropertyPath propertyPath,
String collateName,
boolean isAscending)
Add field sort criteria.
|
void |
aliasNotFound(String alias)
What to do when a mentioned alias is not found.
|
void |
deactivateAggregation() |
void |
deactivateBoolean() |
protected SingleEntityHavingQueryBuilder<?> |
getHavingBuilder()
Return the optional HAVING clause builder.
|
abstract R |
getResult()
Returns the result created by this delegate after the tree processing has been finished.
|
void |
groupingValue(String collateName) |
boolean |
isPersisterReferenceAlias() |
boolean |
isUnqualifiedPropertyReference() |
void |
popStrategy() |
void |
predicateBetween(String lower,
String upper) |
void |
predicateEquals(String comparativePredicate)
This implements the equality predicate; the comparison
predicate could be a constant, a subfunction or
some random type parameter.
|
void |
predicateGreater(String comparativePredicate) |
void |
predicateGreaterOrEqual(String comparativePredicate) |
void |
predicateIn(List<String> list) |
void |
predicateIsNull() |
void |
predicateLess(String comparativePredicate) |
void |
predicateLessOrEqual(String comparativePredicate) |
void |
predicateLike(String patternValue,
Character escapeCharacter) |
void |
predicateNotEquals(String comparativePredicate) |
void |
pushFromStrategy(JoinType joinType,
org.antlr.runtime.tree.Tree assosiationFetchTree,
org.antlr.runtime.tree.Tree propertyFetchTree,
org.antlr.runtime.tree.Tree alias) |
void |
pushGroupByStrategy() |
void |
pushHavingStrategy() |
void |
pushOrderByStrategy() |
void |
pushSelectStrategy() |
void |
pushWhereStrategy() |
void |
registerEmbeddedAlias(String alias,
PropertyPath propertyPath) |
void |
registerJoinAlias(org.antlr.runtime.tree.Tree alias,
PropertyPath path) |
void |
registerPersisterSpace(org.antlr.runtime.tree.Tree entityName,
org.antlr.runtime.tree.Tree alias)
See rule entityName
|
protected List<String> |
resolveAlias(PropertyPath path) |
void |
setPropertyReferencePath(PropertyPath propertyPath) |
void |
sortSpecification(String collateName,
String orderSpec)
Sets the sort direction, either "asc" or "desc", for the current property.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setPropertyPath
protected static final String SORT_ASC_SPEC
protected SingleEntityQueryRendererDelegate.Status status
protected String targetTypeName
protected Class<?> targetType
protected PropertyPath propertyPath
protected AggregationPropertyPath.Type aggregationType
protected final SingleEntityQueryBuilder<Q> builder
protected final Map<String,String> aliasToEntityType
protected final Map<String,PropertyPath> aliasToPropertyPath
protected String alias
public SingleEntityQueryRendererDelegate(PropertyHelper propertyHelper, EntityNamesResolver entityNames, SingleEntityQueryBuilder<Q> builder, Map<String,Object> namedParameters)
protected SingleEntityHavingQueryBuilder<?> getHavingBuilder()
public void registerPersisterSpace(org.antlr.runtime.tree.Tree entityName, org.antlr.runtime.tree.Tree alias)
registerPersisterSpace
in interface QueryRendererDelegate<R>
public void registerEmbeddedAlias(String alias, PropertyPath propertyPath)
public boolean isUnqualifiedPropertyReference()
isUnqualifiedPropertyReference
in interface QueryRendererDelegate<R>
public boolean isPersisterReferenceAlias()
isPersisterReferenceAlias
in interface QueryRendererDelegate<R>
public void pushFromStrategy(JoinType joinType, org.antlr.runtime.tree.Tree assosiationFetchTree, org.antlr.runtime.tree.Tree propertyFetchTree, org.antlr.runtime.tree.Tree alias)
pushFromStrategy
in interface QueryRendererDelegate<R>
public void pushSelectStrategy()
pushSelectStrategy
in interface QueryRendererDelegate<R>
public void pushWhereStrategy()
pushWhereStrategy
in interface QueryRendererDelegate<R>
public void pushGroupByStrategy()
pushGroupByStrategy
in interface QueryRendererDelegate<R>
public void pushHavingStrategy()
pushHavingStrategy
in interface QueryRendererDelegate<R>
public void pushOrderByStrategy()
pushOrderByStrategy
in interface QueryRendererDelegate<R>
public void popStrategy()
popStrategy
in interface QueryRendererDelegate<R>
public void activateOR()
activateOR
in interface QueryRendererDelegate<R>
public void activateAND()
activateAND
in interface QueryRendererDelegate<R>
public void activateNOT()
activateNOT
in interface QueryRendererDelegate<R>
public void predicateLess(String comparativePredicate)
predicateLess
in interface QueryRendererDelegate<R>
public void predicateLessOrEqual(String comparativePredicate)
predicateLessOrEqual
in interface QueryRendererDelegate<R>
public void predicateEquals(String comparativePredicate)
predicateEquals
in interface QueryRendererDelegate<R>
public void predicateNotEquals(String comparativePredicate)
predicateNotEquals
in interface QueryRendererDelegate<R>
public void predicateGreaterOrEqual(String comparativePredicate)
predicateGreaterOrEqual
in interface QueryRendererDelegate<R>
public void predicateGreater(String comparativePredicate)
predicateGreater
in interface QueryRendererDelegate<R>
public void predicateIn(List<String> list)
predicateIn
in interface QueryRendererDelegate<R>
public void predicateBetween(String lower, String upper)
predicateBetween
in interface QueryRendererDelegate<R>
public void predicateLike(String patternValue, Character escapeCharacter)
predicateLike
in interface QueryRendererDelegate<R>
public void predicateIsNull()
predicateIsNull
in interface QueryRendererDelegate<R>
public void setPropertyReferencePath(PropertyPath propertyPath)
setPropertyReferencePath
in interface QueryRendererDelegate<R>
public void activateAggregation(AggregationPropertyPath.Type aggregationType)
activateAggregation
in interface QueryRendererDelegate<R>
public void deactivateAggregation()
deactivateAggregation
in interface QueryRendererDelegate<R>
public void sortSpecification(String collateName, String orderSpec)
QueryRendererDelegate
QueryRendererDelegate.setPropertyPath(PropertyPath)
sortSpecification
in interface QueryRendererDelegate<R>
collateName
- optional collation nameorderSpec
- a string with possible values "asc" or "desc"public void groupingValue(String collateName)
groupingValue
in interface QueryRendererDelegate<R>
collateName
- optional collation nameprotected void addSortField(PropertyPath propertyPath, String collateName, boolean isAscending)
propertyPath
- the path of the field being sortedcollateName
- optional collation nameisAscending
- sort directionprotected void addGrouping(PropertyPath propertyPath, String collateName)
propertyPath
- the path of the field used for groupingcollateName
- optional collation namepublic void deactivateBoolean()
deactivateBoolean
in interface QueryRendererDelegate<R>
public abstract R getResult()
QueryRendererDelegate
getResult
in interface QueryRendererDelegate<R>
protected List<String> resolveAlias(PropertyPath path)
public void registerJoinAlias(org.antlr.runtime.tree.Tree alias, PropertyPath path)
registerJoinAlias
in interface QueryRendererDelegate<R>
public void aliasNotFound(String alias)
alias
- the name of the alias which wasn't recognisedCopyright © 2017. All rights reserved.