Top Description Inners Fields Constructors Methods
org.eclipse.persistence.jpa.jpql.tools.model

public abstract Class BasicStateObjectBuilder

extends AbstractExpressionVisitor
Class Inheritance
Known Direct Subclasses
org.eclipse.persistence.jpa.jpql.tools.model.EclipseLinkStateObjectBuilder, org.eclipse.persistence.jpa.jpql.tools.model.DefaultStateObjectBuilder
Annotations
@SuppressWarnings:nls
Imports
java.util.ArrayList, .Collections, .List, org.eclipse.persistence.jpa.jpql.LiteralType, .LiteralVisitor, org.eclipse.persistence.jpa.jpql.parser.AbsExpression, .AbstractExpression, .AbstractExpressionVisitor, .AbstractSchemaName, .AbstractTraverseChildrenVisitor, .AdditionExpression, .AllOrAnyExpression, .AndExpression, .AnonymousExpressionVisitor, .ArithmeticFactor, .AvgFunction, .BadExpression, .BetweenExpression, .CaseExpression, .CoalesceExpression, .CollectionExpression, .CollectionMemberDeclaration, .CollectionMemberExpression, .CollectionValuedPathExpression, .ComparisonExpression, .ConcatExpression, .ConstructorExpression, .CountFunction, .DateTime, .DeleteClause, .DeleteStatement, .DivisionExpression, .EmptyCollectionComparisonExpression, .EntityTypeLiteral, .EntryExpression, .ExistsExpression, .Expression, .FromClause, .FunctionExpression, .GroupByClause, .HavingClause, .IdentificationVariable, .IdentificationVariableDeclaration, .InExpression, .IndexExpression, .InputParameter, .JPQLExpression, .Join, .KeyExpression, .KeywordExpression, .LengthExpression, .LikeExpression, .LocateExpression, .LowerExpression, .MaxFunction, .MinFunction, .ModExpression, .MultiplicationExpression, .NotExpression, .NullComparisonExpression, .NullExpression, .NullIfExpression, .NumericLiteral, .ObjectExpression, .OnClause, .OrExpression, .OrderByClause, .OrderByItem, .RangeVariableDeclaration, .ResultVariable, .SelectClause, .SelectStatement, .SimpleFromClause, .SimpleSelectClause, .SimpleSelectStatement, .SizeExpression, .SqrtExpression, .StateFieldPathExpression, .StringLiteral, .SubExpression, .SubstringExpression, .SubtractionExpression, .SumFunction, .TreatExpression, .TrimExpression, .TypeExpression, .UnknownExpression, .UpdateClause, .UpdateItem, .UpdateStatement, .UpperExpression, .ValueExpression, .WhenClause, .WhereClause, org.eclipse.persistence.jpa.jpql.tools.model.query.AbsExpressionStateObject, .AbstractFromClauseStateObject, .AbstractIdentificationVariableDeclarationStateObject, .AbstractRangeVariableDeclarationStateObject, .AbstractSchemaNameStateObject, .AbstractSelectStatementStateObject, .AbstractStateObjectVisitor, .AdditionExpressionStateObject, .AllOrAnyExpressionStateObject, .AndExpressionStateObject, .ArithmeticFactorStateObject, .AvgFunctionStateObject, .BadExpressionStateObject, .BetweenExpressionStateObject, .CaseExpressionStateObject, .CoalesceExpressionStateObject, .CollectionExpressionStateObject, .CollectionMemberDeclarationStateObject, .CollectionMemberExpressionStateObject, .CollectionValuedPathExpressionStateObject, .ComparisonExpressionStateObject, .ConcatExpressionStateObject, .ConstructorExpressionStateObject, .CountFunctionStateObject, .DateTimeStateObject, .DeleteStatementStateObject, .DerivedPathIdentificationVariableDeclarationStateObject, .DivisionExpressionStateObject, .EmptyCollectionComparisonExpressionStateObject, .EntityTypeLiteralStateObject, .EntryExpressionStateObject, .ExistsExpressionStateObject, .FromClauseStateObject, .FunctionExpressionStateObject, .GroupByClauseStateObject, .HavingClauseStateObject, .IdentificationVariableDeclarationStateObject, .IdentificationVariableStateObject, .InExpressionStateObject, .IndexExpressionStateObject, .InputParameterStateObject, .JPQLQueryStateObject, .JoinStateObject, .KeyExpressionStateObject, .KeywordExpressionStateObject, .LengthExpressionStateObject, .LikeExpressionStateObject, .LocateExpressionStateObject, .LowerExpressionStateObject, .MaxFunctionStateObject, .MinFunctionStateObject, .ModExpressionStateObject, .MultiplicationExpressionStateObject, .NotExpressionStateObject, .NullComparisonExpressionStateObject, .NullIfExpressionStateObject, .NumericLiteralStateObject, .ObjectExpressionStateObject, .OrExpressionStateObject, .OrderByClauseStateObject, .OrderByItemStateObject, .ResultVariableStateObject, .SelectClauseStateObject, .SelectStatementStateObject, .SimpleFromClauseStateObject, .SimpleSelectClauseStateObject, .SimpleSelectStatementStateObject, .SizeExpressionStateObject, .SqrtExpressionStateObject, .StateFieldPathExpressionStateObject, .StateObject, .StateObjectVisitor, .StringLiteralStateObject, .SubExpressionStateObject, .SubstringExpressionStateObject, .SubtractionExpressionStateObject, .SumFunctionStateObject, .TreatExpressionStateObject, .TrimExpressionStateObject, .TypeExpressionStateObject, .UnknownExpressionStateObject, .UpdateClauseStateObject, .UpdateItemStateObject, .UpdateStatementStateObject, .UpperExpressionStateObject, .ValueExpressionStateObject, .WhenClauseStateObject, .WhereClauseStateObject, org.eclipse.persistence.jpa.jpql.tools.spi.IManagedTypeProvider, org.eclipse.persistence.jpa.jpql.utility.CollectionTools

The default implementation of a 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.

Author
Pascal Filion
Since
2.4
Version
2.5
See Also
Expression, StateObject

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected abstract 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 abstract 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 static class
protected static class
protected class
BasicStateObjectBuilder.DeleteStatementBuilder

This builder is responsible to create the StateObject representation of the DELETE query statement.

protected class
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.

Field Summary

Modifier and TypeField and Description
private IBuilder<CollectionMemberDeclarationStateObject, AbstractFromClauseStateObject>
private BasicStateObjectBuilder.CollectionExpressionVisitor
private IBuilder<DeleteStatementStateObject, JPQLQueryStateObject>
private IBuilder<JoinStateObject, AbstractIdentificationVariableDeclarationStateObject>
joinBuilder

This IBuilder is responsible to build an DELETE statement, which populates the DELETE clause and the optional WHERE clause by converting the information contained in the parsed JPQL query.

pack-priv IJPQLQueryBuilder
private LiteralVisitor
literalVisitor

This visitor is used to retrieve a variable name from various type of an Expression.

protected IManagedTypeProvider
protected JPQLQueryStateObject
parent

The parent StateObject of the StateObject to create.

private IBuilder<AbstractIdentificationVariableDeclarationStateObject, FromClauseStateObject>
private IBuilder<StateObject, SelectClauseStateObject>
private IBuilder<SelectStatementStateObject, JPQLQueryStateObject>
selectStatementBuilder

This IBuilder is responsible to build a top-level SELECT statement, which populates the various clauses by converting the information contained in the parsed JPQL query.

private IBuilder<AbstractIdentificationVariableDeclarationStateObject, SimpleFromClauseStateObject>
private IBuilder<SimpleSelectStatementStateObject, StateObject>
simpleSelectStatementBuilder

This IBuilder is responsible to build a subquery SELECT statement, which populates the various clauses by converting the information contained in the parsed JPQL query.

protected StateObject
stateObject

The StateObject that was created based on the visited Expression.

private IBuilder<UpdateStatementStateObject, JPQLQueryStateObject>
updateStatementBuilder

This IBuilder is responsible to build an UPDATE statement, which populates the UPDATE clause and the optional WHERE clause by converting the information contained in the parsed JPQL query.

private IBuilder<CaseExpressionStateObject, CaseExpressionStateObject>
whenClauseBuilder

This IBuilder is responsible to build a WHEN clause for the CASE expression by converting the information contained in the parsed JPQL query.

Constructor Summary

AccessConstructor and Description
protected
BasicStateObjectBuilder()

Creates a new StateObjectBuilder.

Method Summary

Modifier and TypeMethod and Description
protected <T extends StateObject> List<T>
protected IBuilder<CollectionMemberDeclarationStateObject, AbstractFromClauseStateObject>
protected IBuilder<DeleteStatementStateObject, JPQLQueryStateObject>
protected IBuilder<JoinStateObject, AbstractIdentificationVariableDeclarationStateObject>
protected abstract LiteralVisitor

Returns:

A new concrete instance of LiteralVisitor
buildLiteralVisitor
()

Creates the visitor that can retrieve the "literal" value from a given Expression based on the desired LiteralType.

protected IBuilder<AbstractIdentificationVariableDeclarationStateObject, FromClauseStateObject>
protected IBuilder<StateObject, SelectClauseStateObject>
protected IBuilder<SelectStatementStateObject, JPQLQueryStateObject>
protected IBuilder<AbstractIdentificationVariableDeclarationStateObject, SimpleFromClauseStateObject>
protected IBuilder<SimpleSelectStatementStateObject, StateObject>
protected final StateObject

Returns:

The StateObject representation of the given Expression or null if nothing could be created
buildStateObjectImp
(Expression
The Expression to be visited by this builder
expression
)

Visits the given Expression and returned its StateObject.

protected IBuilder<UpdateStatementStateObject, JPQLQueryStateObject>
protected IBuilder<CaseExpressionStateObject, CaseExpressionStateObject>
protected <T extends Expression> List<T>
children(Expression expression)

protected IBuilder<CollectionMemberDeclarationStateObject, AbstractFromClauseStateObject>
protected BasicStateObjectBuilder.CollectionExpressionVisitor
protected IBuilder<DeleteStatementStateObject, JPQLQueryStateObject>
protected IBuilder<JoinStateObject, AbstractIdentificationVariableDeclarationStateObject>
protected LiteralVisitor
protected IBuilder<AbstractIdentificationVariableDeclarationStateObject, FromClauseStateObject>
protected IBuilder<StateObject, SelectClauseStateObject>
protected IBuilder<SelectStatementStateObject, JPQLQueryStateObject>
protected IBuilder<AbstractIdentificationVariableDeclarationStateObject, SimpleFromClauseStateObject>
protected IBuilder<SimpleSelectStatementStateObject, StateObject>
public StateObject

Returns:

The StateObject that was created based on the visited Expression
getStateObject
()

Returns the StateObject that was created based on the visited Expression.

protected IBuilder<UpdateStatementStateObject, JPQLQueryStateObject>
protected String

Returns:

A value from the given Expression or an empty string if the given Expression and the LiteralType do not match
literal
(Expression
The Expression to visit
expression
,
LiteralType
The LiteralType helps to determine what to retrieve from the visited Expression
type
)

Retrieves the "literal" from the given Expression.

public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public final void
public void
public final void
public void
public void
public final void
public void
public void
public void
public final void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public final void
public final void
public void
public final void
public final void
public final void
public void
public final void
public final void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public void
public final void
public final void
public void
public void
public void
public final void
public void
protected IBuilder<CaseExpressionStateObject, CaseExpressionStateObject>

Returns:

The builder of the WHEN clauses
whenClauseBuilder
()

Returns the IBuilder that is responsible to visit each WhenClause and to create the corresponding WhenClauseStateObject.

Inherited from org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor:
visitvisitvisitvisitvisitvisitvisitvisitvisit