Class AbstractSqlLikeQueryBuilder2.SqlSelectionVisitor
java.lang.Object
io.micronaut.data.model.query.builder.sql.AbstractSqlLikeQueryBuilder2.SqlSelectionVisitor
- All Implemented Interfaces:
ExpressionVisitor
,SelectionVisitor
- Direct Known Subclasses:
SqlQueryBuilder2.SqlSelectionVisitor
- Enclosing class:
- AbstractSqlLikeQueryBuilder2
protected class AbstractSqlLikeQueryBuilder2.SqlSelectionVisitor
extends Object
implements SelectionVisitor
The selection visitor to construct the query.
-
Field Summary
Modifier and TypeFieldDescriptionprotected final io.micronaut.core.annotation.AnnotationMetadata
protected String
protected final boolean
protected final PersistentEntity
protected final StringBuilder
protected final AbstractSqlLikeQueryBuilder2.QueryState
protected final String
-
Constructor Summary
ConstructorDescriptionSqlSelectionVisitor
(AbstractSqlLikeQueryBuilder2.QueryState queryState, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean distinct) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendAssociationProjection
(Association association, PersistentPropertyPath propertyPath) Appends selection projection for the property which is association.protected void
appendCompoundAssociationProjection
(PersistentAssociationPath propertyPath) Appends the compound (part of entity or DTO) association projection.protected void
appendCompoundPropertyProjection
(PersistentPropertyPath propertyPath) Appends the compound (part of entity or DTO) property projection.protected final void
appendProperty
(StringBuilder sb, List<Association> associations, PersistentProperty property, NamingStrategy namingStrategy, String tableAlias, boolean escape) protected void
Append the property projection.protected void
appendRowCount
(String logicalName) Appends a row count projection to the query string.protected void
appendRowCountDistinct
(String logicalName) Appends a row count distinct projection to the query string.protected void
selectAllColumns
(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, PersistentEntity persistentEntity, String tableAlias) Select all the columns from the entity.protected void
Select all the columns from the entity and the joined entities.protected void
selectAllColumnsFromJoinPaths
(Collection<JoinPath> allPaths, @Nullable Map<JoinPath, String> joinAliasOverride) Does nothing but subclasses might override and implement new behavior.void
visit
(BinaryExpression<?> binaryExpression) VisitBinaryExpression
.void
visit
(FunctionExpression<?> functionExpression) VisitFunctionExpression
.void
visit
(IdExpression<?, ?> idExpression) VisitIdExpression
.void
visit
(LiteralExpression<?> literalExpression) VisitLiteralExpression
.void
visit
(UnaryExpression<?> unaryExpression) VisitUnaryExpression
.void
visit
(AliasedSelection<?> aliasedSelection) VisitAliasedSelection
.void
visit
(CompoundSelection<?> compoundSelection) VisitCompoundSelection
.void
visit
(PersistentEntityRoot<?> entityRoot) VisitPersistentEntityRoot
.void
visit
(PersistentEntitySubquery<?> subquery) VisitPersistentEntitySubquery
.void
visit
(PersistentPropertyPath<?> persistentPropertyPath) VisitPersistentPropertyPath
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.micronaut.data.model.jpa.criteria.impl.ExpressionVisitor
visit
Methods inherited from interface io.micronaut.data.model.jpa.criteria.impl.SelectionVisitor
visit, visit
-
Field Details
-
queryState
-
query
-
annotationMetadata
protected final io.micronaut.core.annotation.AnnotationMetadata annotationMetadata -
distinct
protected final boolean distinct -
tableAlias
-
entity
-
columnAlias
-
-
Constructor Details
-
SqlSelectionVisitor
public SqlSelectionVisitor(AbstractSqlLikeQueryBuilder2.QueryState queryState, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean distinct)
-
-
Method Details
-
visit
Description copied from interface:ExpressionVisitor
VisitPersistentPropertyPath
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
persistentPropertyPath
- The persistentPropertyPath
-
visit
Description copied from interface:SelectionVisitor
VisitAliasedSelection
.- Specified by:
visit
in interfaceSelectionVisitor
- Parameters:
aliasedSelection
- The aliasedSelection
-
visit
Description copied from interface:ExpressionVisitor
VisitPersistentEntityRoot
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
entityRoot
- The entityRoot
-
visit
Description copied from interface:ExpressionVisitor
VisitPersistentEntitySubquery
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
subquery
- The subquery
-
visit
Description copied from interface:SelectionVisitor
VisitCompoundSelection
.- Specified by:
visit
in interfaceSelectionVisitor
- Parameters:
compoundSelection
- The compoundSelection
-
visit
Description copied from interface:ExpressionVisitor
VisitLiteralExpression
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
literalExpression
- The literalExpression
-
visit
Description copied from interface:ExpressionVisitor
VisitUnaryExpression
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
unaryExpression
- The unary expression
-
visit
Description copied from interface:ExpressionVisitor
VisitBinaryExpression
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
binaryExpression
- The aggregateExpression
-
visit
Description copied from interface:ExpressionVisitor
VisitIdExpression
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
idExpression
- The idExpression
-
visit
Description copied from interface:ExpressionVisitor
VisitFunctionExpression
.- Specified by:
visit
in interfaceExpressionVisitor
- Parameters:
functionExpression
- The function expression
-
appendCompoundPropertyProjection
Appends the compound (part of entity or DTO) property projection.- Parameters:
propertyPath
- The property path
-
appendCompoundAssociationProjection
@Internal protected void appendCompoundAssociationProjection(PersistentAssociationPath propertyPath) Appends the compound (part of entity or DTO) association projection.- Parameters:
propertyPath
- The property path
-
appendPropertyProjection
protected void appendPropertyProjection(AbstractSqlLikeQueryBuilder2.QueryPropertyPath propertyPath) Append the property projection.- Parameters:
propertyPath
- The property
-
appendAssociationProjection
protected void appendAssociationProjection(Association association, PersistentPropertyPath propertyPath) Appends selection projection for the property which is association.- Parameters:
association
- the persistent propertypropertyPath
- the persistent property path
-
appendRowCount
Appends a row count projection to the query string.- Parameters:
logicalName
- The alias to the table name
-
appendRowCountDistinct
Appends a row count distinct projection to the query string.- Parameters:
logicalName
- The alias to the table name
-
selectAllColumns
protected void selectAllColumns(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, PersistentEntity persistentEntity, String tableAlias) Select all the columns from the entity.- Parameters:
annotationMetadata
- The annotation metadatapersistentEntity
- The persistent entitytableAlias
- The table alias
-
selectAllColumnsAndJoined
protected void selectAllColumnsAndJoined()Select all the columns from the entity and the joined entities. -
selectAllColumnsFromJoinPaths
protected void selectAllColumnsFromJoinPaths(Collection<JoinPath> allPaths, @Nullable @Nullable Map<JoinPath, String> joinAliasOverride) Does nothing but subclasses might override and implement new behavior.- Parameters:
allPaths
- The join pathsjoinAliasOverride
- The join alias override
-
appendProperty
protected final void appendProperty(StringBuilder sb, List<Association> associations, PersistentProperty property, NamingStrategy namingStrategy, String tableAlias, boolean escape)
-