public abstract class BasicStateObjectBuilder extends AbstractExpressionVisitor
IBuilder
, which creates a StateObject
representation of the Expression
being
visited.
Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves.
Expression
,
StateObject
Modifier and Type | Class and Description |
---|---|
protected class |
BasicStateObjectBuilder.AbstractRangeDeclarationBuilder<S extends AbstractFromClauseStateObject>
This builder is responsible to create a new identification variable declaration and to add it
to the state object representing the
FROM clause. |
protected class |
BasicStateObjectBuilder.AbstractSelectStatementBuilder<T extends AbstractSelectStatementStateObject,P extends StateObject>
The abstract definition of the builder that is responsible to create the
StateObject
representation of the SELECT statement. |
protected class |
BasicStateObjectBuilder.CollectionExpressionVisitor |
protected class |
BasicStateObjectBuilder.CollectionMemberDeclarationBuilder |
protected class |
BasicStateObjectBuilder.DeleteStatementBuilder
This builder is responsible to create the
StateObject representation of the
DELETE query statement. |
protected class |
BasicStateObjectBuilder.JoinBuilder |
protected class |
BasicStateObjectBuilder.RangeDeclarationBuilder
This builder is responsible to create a new identification variable declaration and to add it
to the state object representing the
FROM clause of the top-level query. |
protected class |
BasicStateObjectBuilder.SelectItemBuilder
This builder is responsible to create the items owned by the top-level
SELECT clause. |
protected class |
BasicStateObjectBuilder.SelectStatementBuilder
This builder is responsible to create the
StateObject representation of the
SELECT query statement. |
protected class |
BasicStateObjectBuilder.SimpleRangeDeclarationBuilder
This builder is responsible to create a new identification variable declaration and to add it
to the state object representing the
FROM clause of a subquery. |
protected class |
BasicStateObjectBuilder.SimpleSelectStatementBuilder
This builder is responsible to create the
StateObject representation of the
SELECT subquery. |
protected class |
BasicStateObjectBuilder.UpdateStatementBuilder
This builder is responsible to create the
StateObject representation of the
UPDATE query statement. |
protected class |
BasicStateObjectBuilder.WhenClauseBuilder
This builder is responsible to create the
WHEN clauses for a
CASE expression. |
Modifier and Type | Field and Description |
---|---|
protected IManagedTypeProvider |
managedTypeProvider |
protected JPQLQueryStateObject |
parent
The parent
StateObject of the StateObject to create. |
protected StateObject |
stateObject
The
StateObject that was created based on the visited Expression . |
Modifier | Constructor and Description |
---|---|
protected |
BasicStateObjectBuilder()
Creates a new
StateObjectBuilder . |
protected IManagedTypeProvider managedTypeProvider
protected JPQLQueryStateObject parent
StateObject
of the StateObject
to create.protected StateObject stateObject
StateObject
that was created based on the visited Expression
.protected BasicStateObjectBuilder()
StateObjectBuilder
.protected <T extends StateObject> java.util.List<T> buildChildren(Expression expression)
protected IBuilder<CollectionMemberDeclarationStateObject,AbstractFromClauseStateObject> buildCollectionDeclarationBuilder()
protected IBuilder<DeleteStatementStateObject,JPQLQueryStateObject> buildDeleteStatementBuilder()
protected IBuilder<JoinStateObject,AbstractIdentificationVariableDeclarationStateObject> buildJoinBuilder()
protected abstract LiteralVisitor buildLiteralVisitor()
Expression
based on the desired LiteralType
.LiteralVisitor
protected IBuilder<AbstractIdentificationVariableDeclarationStateObject,FromClauseStateObject> buildRangeDeclarationBuilder()
protected IBuilder<StateObject,SelectClauseStateObject> buildSelectItemBuilder()
protected IBuilder<SelectStatementStateObject,JPQLQueryStateObject> buildSelectStatementBuilder()
protected IBuilder<AbstractIdentificationVariableDeclarationStateObject,SimpleFromClauseStateObject> buildSimpleRangeDeclarationBuilder()
protected IBuilder<SimpleSelectStatementStateObject,StateObject> buildSimpleSelectStatementBuilder()
protected final StateObject buildStateObjectImp(Expression expression)
Expression
and returned its StateObject
.expression
- The Expression
to be visited by this builderStateObject
representation of the given Expression
or null
if nothing could be createdprotected IBuilder<UpdateStatementStateObject,JPQLQueryStateObject> buildUpdateStatementBuilder()
protected IBuilder<CaseExpressionStateObject,CaseExpressionStateObject> buildWhenClauseBuilder()
protected <T extends Expression> java.util.List<T> children(Expression expression)
protected IBuilder<CollectionMemberDeclarationStateObject,AbstractFromClauseStateObject> getCollectionDeclarationBuilder()
protected BasicStateObjectBuilder.CollectionExpressionVisitor getCollectionExpressionVisitor()
protected IBuilder<DeleteStatementStateObject,JPQLQueryStateObject> getDeleteStatementBuilder()
protected IBuilder<JoinStateObject,AbstractIdentificationVariableDeclarationStateObject> getJoinBuilder()
protected LiteralVisitor getLiteralVisitor()
protected IBuilder<AbstractIdentificationVariableDeclarationStateObject,FromClauseStateObject> getRangeDeclarationBuilder()
protected IBuilder<StateObject,SelectClauseStateObject> getSelectItemBuilder()
protected IBuilder<SelectStatementStateObject,JPQLQueryStateObject> getSelectStatementBuilder()
protected IBuilder<AbstractIdentificationVariableDeclarationStateObject,SimpleFromClauseStateObject> getSimpleRangeDeclarationBuilder()
protected IBuilder<SimpleSelectStatementStateObject,StateObject> getSimpleSelectStatementBuilder()
public StateObject getStateObject()
StateObject
that was created based on the visited Expression
.StateObject
that was created based on the visited Expression
protected IBuilder<UpdateStatementStateObject,JPQLQueryStateObject> getUpdateStatementBuilder()
protected java.lang.String literal(Expression expression, LiteralType type)
Expression
. The literal to retrieve depends on
the given type
. The literal is basically a string value like an
identification variable name, an input parameter, a path expression, an abstract schema name,
etc.expression
- The Expression
to visittype
- The LiteralType
helps to determine what to retrieve from the visited
Expression
Expression
or an empty string if the given Expression
and the LiteralType
do not matchpublic void visit(AbsExpression expression)
AbsExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(AbstractSchemaName expression)
AbstractSchemaName
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(AdditionExpression expression)
AdditionExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(AllOrAnyExpression expression)
AllOrAnyExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(AndExpression expression)
AndExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(ArithmeticFactor expression)
ArithmeticFactor
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(AvgFunction expression)
AvgFunction
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(BadExpression expression)
BadExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(BetweenExpression expression)
BetweenExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(CaseExpression expression)
CaseExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(CoalesceExpression expression)
CoalesceExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(CollectionExpression expression)
CollectionExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(CollectionMemberDeclaration expression)
CollectionMemberDeclaration
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(CollectionMemberExpression expression)
CollectionMemberExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(CollectionValuedPathExpression expression)
CollectionValuedPathExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(ComparisonExpression expression)
ComparisonExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(ConcatExpression expression)
ConcatExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(ConstructorExpression expression)
ConstructorExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(CountFunction expression)
CountFunction
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(DateTime expression)
DateTime
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(DeleteClause expression)
DeleteClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(DeleteStatement expression)
DeleteStatement
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(DivisionExpression expression)
DivisionExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(EmptyCollectionComparisonExpression expression)
EmptyCollectionComparisonExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(EntityTypeLiteral expression)
EntityTypeLiteral
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(EntryExpression expression)
EntryExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(ExistsExpression expression)
ExistsExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(FromClause expression)
FromClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(FunctionExpression expression)
FunctionExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(GroupByClause expression)
GroupByClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(HavingClause expression)
HavingClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(IdentificationVariable expression)
IdentificationVariable
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(IdentificationVariableDeclaration expression)
IdentificationVariableDeclaration
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(IndexExpression expression)
IndexExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(InExpression expression)
InExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(InputParameter expression)
InputParameter
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(Join expression)
Join
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(JPQLExpression expression)
JPQLExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(KeyExpression expression)
KeyExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(KeywordExpression expression)
KeywordExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(LengthExpression expression)
LengthExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(LikeExpression expression)
LikeExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(LocateExpression expression)
LocateExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(LowerExpression expression)
LowerExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(MaxFunction expression)
MaxFunction
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(MinFunction expression)
MinFunction
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(ModExpression expression)
ModExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(MultiplicationExpression expression)
MultiplicationExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(NotExpression expression)
NotExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(NullComparisonExpression expression)
NullComparisonExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(NullExpression expression)
NullExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(NullIfExpression expression)
NullIfExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(NumericLiteral expression)
NumericLiteral
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(ObjectExpression expression)
ObjectExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(OnClause expression)
OnClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(OrderByClause expression)
OrderByClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(OrderByItem expression)
OrderByItem
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(OrExpression expression)
OrExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(RangeVariableDeclaration expression)
RangeVariableDeclaration
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(ResultVariable expression)
ResultVariable
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(SelectClause expression)
SelectClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SelectStatement expression)
SelectStatement
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(SimpleFromClause expression)
SimpleFromClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic final void visit(SimpleSelectClause expression)
SimpleSelectClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SimpleSelectStatement expression)
SimpleSelectStatement
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SizeExpression expression)
SizeExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SqrtExpression expression)
SqrtExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(StateFieldPathExpression expression)
StateFieldPathExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(StringLiteral expression)
StringLiteral
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SubExpression expression)
SubExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SubstringExpression expression)
SubstringExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SubtractionExpression expression)
SubtractionExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(SumFunction expression)
SumFunction
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(TreatExpression expression)
TreatExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(TrimExpression expression)
TrimExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(TypeExpression expression)
TypeExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The Expression
to visitpublic void visit(UnknownExpression expression)
UnknownExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The UnknownExpression
to visitpublic final void visit(UpdateClause expression)
UpdateClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The UpdateClause
to visitpublic final void visit(UpdateItem expression)
UpdateItem
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The UpdateItem
to visitpublic void visit(UpdateStatement expression)
UpdateStatement
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The UpdateStatement
to visitpublic void visit(UpperExpression expression)
UpperExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The UpperExpression
to visitpublic void visit(ValueExpression expression)
ValueExpression
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The ValueExpression
to visitpublic final void visit(WhenClause expression)
WhenClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The WhenClause
to visitpublic void visit(WhereClause expression)
WhereClause
expression.visit
in interface ExpressionVisitor
visit
in class AbstractExpressionVisitor
expression
- The WhereClause
to visitprotected IBuilder<CaseExpressionStateObject,CaseExpressionStateObject> whenClauseBuilder()
IBuilder
that is responsible to visit each WhenClause
and to
create the corresponding WhenClauseStateObject
. The new state objects have to be added
to CaseExpressionStateObject
by the builder.WHEN
clauses