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
FieldsModifier and TypeFieldDescriptionprotected final io.micronaut.core.annotation.AnnotationMetadataprotected Stringprotected final booleanprotected final PersistentEntityprotected final StringBuilderprotected final AbstractSqlLikeQueryBuilder2.QueryStateprotected final String -
Constructor Summary
ConstructorsConstructorDescriptionSqlSelectionVisitor(AbstractSqlLikeQueryBuilder2.QueryState queryState, io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, boolean distinct) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendAssociationProjection(PersistentAssociationPath associationPath) Appends selection projection for the property which is association.protected voidappendCompoundAssociationProjection(PersistentAssociationPath propertyPath) Appends the compound (part of entity or DTO) association projection.protected voidappendCompoundProjection(PersistentPropertyPath propertyPath) Appends the compound (part of entity or DTO) association projection.protected voidappendCompoundPropertyProjection(PersistentPropertyPath propertyPath) Appends the compound (part of entity or DTO) property projection.protected final voidappendProperty(StringBuilder sb, List<Association> associations, PersistentProperty property, NamingStrategy namingStrategy, String tableAlias, boolean escape) protected voidAppend the property projection.protected voidappendRowCount(String logicalName) Appends a row count projection to the query string.protected voidappendRowCountDistinct(String logicalName) Appends a row count distinct projection to the query string.protected voidselectAllColumns(io.micronaut.core.annotation.AnnotationMetadata annotationMetadata, PersistentEntity persistentEntity, String tableAlias) Select all the columns from the entity.protected voidSelect all the columns from the entity and the joined entities.protected voidselectAllColumnsFromJoinPaths(Collection<JoinPath> allPaths, @Nullable Map<JoinPath, String> joinAliasOverride) Does nothing but subclasses might override and implement new behavior.voidvisit(BinaryExpression<?> binaryExpression) VisitBinaryExpression.voidvisit(FunctionExpression<?> functionExpression) VisitFunctionExpression.voidvisit(IdExpression<?, ?> idExpression) VisitIdExpression.voidvisit(LiteralExpression<?> literalExpression) VisitLiteralExpression.voidvisit(UnaryExpression<?> unaryExpression) VisitUnaryExpression.voidvisit(AliasedSelection<?> aliasedSelection) VisitAliasedSelection.voidvisit(CompoundSelection<?> compoundSelection) VisitCompoundSelection.voidvisit(PersistentEntityRoot<?> entityRoot) VisitPersistentEntityRoot.voidvisit(PersistentEntitySubquery<?> subquery) VisitPersistentEntitySubquery.voidvisit(PersistentPropertyPath<?> persistentPropertyPath) VisitPersistentPropertyPath.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface io.micronaut.data.model.jpa.criteria.impl.ExpressionVisitor
visitMethods 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:ExpressionVisitorVisitPersistentPropertyPath.- Specified by:
visitin interfaceExpressionVisitor- Parameters:
persistentPropertyPath- The persistentPropertyPath
-
visit
Description copied from interface:SelectionVisitorVisitAliasedSelection.- Specified by:
visitin interfaceSelectionVisitor- Parameters:
aliasedSelection- The aliasedSelection
-
visit
Description copied from interface:ExpressionVisitorVisitPersistentEntityRoot.- Specified by:
visitin interfaceExpressionVisitor- Parameters:
entityRoot- The entityRoot
-
visit
Description copied from interface:ExpressionVisitorVisitPersistentEntitySubquery.- Specified by:
visitin interfaceExpressionVisitor- Parameters:
subquery- The subquery
-
visit
Description copied from interface:SelectionVisitorVisitCompoundSelection.- Specified by:
visitin interfaceSelectionVisitor- Parameters:
compoundSelection- The compoundSelection
-
visit
Description copied from interface:ExpressionVisitorVisitLiteralExpression.- Specified by:
visitin interfaceExpressionVisitor- Parameters:
literalExpression- The literalExpression
-
visit
Description copied from interface:ExpressionVisitorVisitUnaryExpression.- Specified by:
visitin interfaceExpressionVisitor- Parameters:
unaryExpression- The unary expression
-
visit
Description copied from interface:ExpressionVisitorVisitBinaryExpression.- Specified by:
visitin interfaceExpressionVisitor- Parameters:
binaryExpression- The aggregateExpression
-
visit
Description copied from interface:ExpressionVisitorVisitIdExpression.- Specified by:
visitin interfaceExpressionVisitor- Parameters:
idExpression- The idExpression
-
visit
Description copied from interface:ExpressionVisitorVisitFunctionExpression.- Specified by:
visitin 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
-
appendCompoundProjection
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
Appends selection projection for the property which is association.- Parameters:
associationPath- 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)
-