Class JPQLQueryBuilderWrapper
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.model.JPQLQueryBuilderWrapper
- All Implemented Interfaces:
IJPQLQueryBuilder
- Direct Known Subclasses:
DefaultEclipseLinkJPQLQueryBuilder,DefaultJPQLQueryBuilder
This builder wraps another builder and simply delegates the calls to it.
- Since:
- 2.4
- Version:
- 2.4
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedJPQLQueryBuilderWrapper(IJPQLQueryBuilder delegate) Creates a newJPQLQueryBuilderWrapper. -
Method Summary
Modifier and TypeMethodDescriptionCreates a builder that can create aCASEexpression programmatically.buildStateObject(StateObject parent, CharSequence jpqlFragment, String queryBNFId) Creates aStateObjectrepresentation of the given JPQL fragment.buildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, boolean tolerant) Creates a state model representation of a JPQL query that can be edited.buildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, String queryBNFId, boolean tolerant) Creates a state model representation of a JPQL query that can be edited.Creates a builder that can create a conditional expression programmatically.buildStateObjectBuilder(SelectClauseStateObject stateObject) Creates a builder that can create a select expression programmatically.buildStateObjectBuilder(SimpleSelectClauseStateObject stateObject) Creates a builder that can create a single select expression programmatically.buildStateObjectBuilder(UpdateItemStateObject stateObject) Creates a builder that can create a new value expression programmatically.protected IJPQLQueryBuilderReturns the delegate builder that receives the calls from this one.Returns theJPQLGrammarthat is associated with this builder.
-
Constructor Details
-
JPQLQueryBuilderWrapper
Creates a newJPQLQueryBuilderWrapper.- Parameters:
delegate- The delegate builder that receives the calls from this one- Throws:
NullPointerException- If the given delegate isnull
-
-
Method Details
-
buildCaseExpressionStateObjectBuilder
Description copied from interface:IJPQLQueryBuilderCreates a builder that can create aCASEexpression programmatically. Once the expression is complete,ICaseExpressionStateObjectBuilder.buildStateObject()will return the result.- Specified by:
buildCaseExpressionStateObjectBuilderin interfaceIJPQLQueryBuilder- Parameters:
parent- TheStateObjectthat will be the parent of the newly created model- Returns:
- The builder of a
CASEexpression
-
buildStateObject
public JPQLQueryStateObject buildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, boolean tolerant) Description copied from interface:IJPQLQueryBuilderCreates a state model representation of a JPQL query that can be edited.- Specified by:
buildStateObjectin interfaceIJPQLQueryBuilder- Parameters:
provider- The provider of managed typesjpqlQuery- The JPQL query to parse into aStateObjectmodeltolerant- Determines if the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries- Returns:
- The root of the
StateObjectmodel that represents the edited form of the JPQL query
-
buildStateObject
public JPQLQueryStateObject buildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, String queryBNFId, boolean tolerant) Description copied from interface:IJPQLQueryBuilderCreates a state model representation of a JPQL query that can be edited.- Specified by:
buildStateObjectin interfaceIJPQLQueryBuilder- Parameters:
provider- The provider of managed typesjpqlQuery- The JPQL query to parse into aStateObjectmodelqueryBNFId- The unique identifier of the query BNF that will be used to parse the fragmenttolerant- Determines if the parsing system should be tolerant, meaning if it should try to parse invalid or incomplete queries- Returns:
- The root of the
StateObjectmodel that represents the edited form of the JPQL query
-
buildStateObject
public StateObject buildStateObject(StateObject parent, CharSequence jpqlFragment, String queryBNFId) Description copied from interface:IJPQLQueryBuilderCreates aStateObjectrepresentation of the given JPQL fragment. In order to properly parse the fragment, the given unique identifier of theJPQLQueryBNFwill determine how to parse it.It is possible the given JPQL fragment has more than one expression, in this case, parsing should stop at the first comma (x, y) or space (x y) where x and y are two separate expressions.
- Specified by:
buildStateObjectin interfaceIJPQLQueryBuilder- Parameters:
parent- TheStateObjectthat will be the parent of the newly created modeljpqlFragment- A portion of a JPQL query that will be parsed and theStateObjectrepresentation will be createdqueryBNFId- The unique identifier of the query BNF that will be used to parse the fragment- Returns:
- The
StateObjectrepresentation of the given JPQL fragment
-
buildStateObjectBuilder
public IConditionalExpressionStateObjectBuilder buildStateObjectBuilder(AbstractConditionalClauseStateObject stateObject) Description copied from interface:IJPQLQueryBuilderCreates a builder that can create a conditional expression programmatically. Once the expression is complete,IConditionalExpressionStateObjectBuilder.commit()will push the result onto the given state object.- Specified by:
buildStateObjectBuilderin interfaceIJPQLQueryBuilder- Parameters:
stateObject- The clause for which a conditional expression can be created- Returns:
- The builder of a conditional expression
-
buildStateObjectBuilder
public ISelectExpressionStateObjectBuilder buildStateObjectBuilder(SelectClauseStateObject stateObject) Description copied from interface:IJPQLQueryBuilderCreates a builder that can create a select expression programmatically. Once the expression is complete,ISelectExpressionStateObjectBuilder.commit()will push the result onto the given state object.- Specified by:
buildStateObjectBuilderin interfaceIJPQLQueryBuilder- Parameters:
stateObject- The clause for which one or many select expressions can be created- Returns:
- The builder of a conditional expression
-
buildStateObjectBuilder
public ISimpleSelectExpressionStateObjectBuilder buildStateObjectBuilder(SimpleSelectClauseStateObject stateObject) Description copied from interface:IJPQLQueryBuilderCreates a builder that can create a single select expression programmatically. Once the expression is complete,ISimpleSelectExpressionStateObjectBuilder.commit()will push the result onto the given state object.- Specified by:
buildStateObjectBuilderin interfaceIJPQLQueryBuilder- Parameters:
stateObject- The clause for which a select expression can be created- Returns:
- The builder of a conditional expression
-
buildStateObjectBuilder
Description copied from interface:IJPQLQueryBuilderCreates a builder that can create a new value expression programmatically. Once the expression is complete,INewValueStateObjectBuilder.commit()will push the result onto the given state object.- Specified by:
buildStateObjectBuilderin interfaceIJPQLQueryBuilder- Parameters:
stateObject- The parent for which a new value expression can be created- Returns:
- The builder of a new value expression
-
getDelegate
Returns the delegate builder that receives the calls from this one.- Returns:
- The wrapped builder
-
getGrammar
Description copied from interface:IJPQLQueryBuilderReturns theJPQLGrammarthat is associated with this builder.- Specified by:
getGrammarin interfaceIJPQLQueryBuilder- Returns:
- The
JPQLGrammarthat was used to parse the JPQL query or JPQL fragments
-