Class PersistenceExpressionSerializer
java.lang.Object
com.blazebit.expression.persistence.PersistenceExpressionSerializer
- All Implemented Interfaces:
Expression.ResultVisitor<Boolean>,ExpressionSerializer<com.blazebit.persistence.WhereBuilder<?>>
public class PersistenceExpressionSerializer extends Object implements Expression.ResultVisitor<Boolean>, ExpressionSerializer<com.blazebit.persistence.WhereBuilder<?>>
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.blazebit.expression.ExpressionSerializer
ExpressionSerializer.Context -
Field Summary
Fields Modifier and Type Field Description static StringCONSTANT_INLINING_INTERPRETER_CONTEXTstatic StringPATHS_TO_INLINE -
Constructor Summary
Constructors Constructor Description PersistenceExpressionSerializer(ExpressionService expressionService)Creates a new serializer for serializing to a Blaze-Persistence Core WhereBuilder. -
Method Summary
Modifier and Type Method Description protected booleanappendPersistenceAttribute(StringBuilder sb, com.blazebit.domain.runtime.model.EntityDomainTypeAttribute attribute)Applies a JPQL.Next expression for the entity domain attribute to the given string builder.ExpressionSerializer.ContextgetContext()Returns the current serialization context.ExpressionServicegetExpressionService()Returns the domain model.protected StringgetPersistenceAlias(Path p)Returns the root alias in the query builder for the path.Map<Object,Object>getProperties()Returns the properties map.StringBuildergetStringBuilder()Returns the current string builder to which the serialization is done.com.blazebit.persistence.WhereBuilder<?>getWhereBuilder()Returns the query builder.StringnextCorrelationAlias()Returns a new correlation alias that may be used in queries.StringregisterSubqueryProvider(PersistenceSubqueryProvider persistenceSubqueryProvider)Registers the given subquery provider and returns the alias for it.voidserializeTo(Expression expression, com.blazebit.persistence.WhereBuilder<?> target)voidserializeTo(ExpressionSerializer.Context newContext, Expression expression, com.blazebit.persistence.WhereBuilder<?> target)Booleanvisit(ArithmeticFactor e)Booleanvisit(BetweenPredicate e)Booleanvisit(ChainingArithmeticExpression e)Booleanvisit(CollectionLiteral e)Booleanvisit(ComparisonPredicate e)Booleanvisit(CompoundPredicate e)Booleanvisit(EntityLiteral e)Booleanvisit(EnumLiteral e)Booleanvisit(ExpressionPredicate e)Booleanvisit(FunctionInvocation e)Booleanvisit(InPredicate e)Booleanvisit(IsEmptyPredicate e)Booleanvisit(IsNullPredicate e)Booleanvisit(Literal e)Booleanvisit(Path e)
-
Field Details
-
Constructor Details
-
PersistenceExpressionSerializer
Creates a new serializer for serializing to a Blaze-Persistence Core WhereBuilder.- Parameters:
expressionService- The expression service
-
-
Method Details
-
getExpressionService
Returns the domain model.- Returns:
- the domain model
-
getContext
Returns the current serialization context.- Returns:
- the current serialization context
-
registerSubqueryProvider
Registers the given subquery provider and returns the alias for it.- Parameters:
persistenceSubqueryProvider- The subquery provider to register- Returns:
- The subquery alias
-
nextCorrelationAlias
Returns a new correlation alias that may be used in queries.- Returns:
- The alias
-
getProperties
Returns the properties map.- Returns:
- the properties map
-
getStringBuilder
Returns the current string builder to which the serialization is done.- Returns:
- the current string builder
-
getWhereBuilder
public com.blazebit.persistence.WhereBuilder<?> getWhereBuilder()Returns the query builder.- Returns:
- the query builder
-
serializeTo
- Specified by:
serializeToin interfaceExpressionSerializer<com.blazebit.persistence.WhereBuilder<?>>
-
serializeTo
public void serializeTo(ExpressionSerializer.Context newContext, Expression expression, com.blazebit.persistence.WhereBuilder<?> target)- Specified by:
serializeToin interfaceExpressionSerializer<com.blazebit.persistence.WhereBuilder<?>>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
appendPersistenceAttribute
protected boolean appendPersistenceAttribute(StringBuilder sb, com.blazebit.domain.runtime.model.EntityDomainTypeAttribute attribute)Applies a JPQL.Next expression for the entity domain attribute to the given string builder.- Parameters:
sb- The string builder to append toattribute- The entity domain attribute- Returns:
trueif no renderer was found,falseotherwise
-
getPersistenceAlias
Returns the root alias in the query builder for the path.- Parameters:
p- The path- Returns:
- The alias in the query builder
- Throws:
IllegalStateException- when the root variable has no registered query builder alias
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-
visit
- Specified by:
visitin interfaceExpression.ResultVisitor<Boolean>
-