Class AbstractJPQLQueryBuilder
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.model.AbstractJPQLQueryBuilder
-
- All Implemented Interfaces:
IJPQLQueryBuilder
- Direct Known Subclasses:
EclipseLinkJPQLQueryBuilder,JPQLQueryBuilder1_0,JPQLQueryBuilder2_0,JPQLQueryBuilder2_1
public abstract class AbstractJPQLQueryBuilder extends Object implements IJPQLQueryBuilder
An abstract implementation ofIJPQLQueryBuilderthat parses a JPQL query or any JPQL fragments and creates theStateObjectrepresentation by delegating the creation to an instance ofBasicStateObjectBuilder.- Since:
- 2.4
- Version:
- 2.4
- Author:
- Pascal Filion
- See Also:
DefaultJPQLQueryBuilder,EclipseLinkJPQLQueryBuilder
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ICaseExpressionStateObjectBuilderbuildCaseExpressionStateObjectBuilder(StateObject parent)Creates a builder that can create aCASEexpression programmatically.StateObjectbuildStateObject(StateObject parent, CharSequence jpqlFragment, String queryBNFId)Creates aStateObjectrepresentation of the given JPQL fragment.JPQLQueryStateObjectbuildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, boolean tolerant)Creates a state model representation of a JPQL query that can be edited.JPQLQueryStateObjectbuildStateObject(IManagedTypeProvider provider, CharSequence jpqlQuery, String queryBNFId, boolean tolerant)Creates a state model representation of a JPQL query that can be edited.-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.eclipse.persistence.jpa.jpql.tools.model.IJPQLQueryBuilder
buildStateObjectBuilder, buildStateObjectBuilder, buildStateObjectBuilder, buildStateObjectBuilder, getGrammar
-
-
-
-
Method Detail
-
buildCaseExpressionStateObjectBuilder
public ICaseExpressionStateObjectBuilder buildCaseExpressionStateObjectBuilder(StateObject parent)
Creates 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)
Creates 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)
Creates 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)
Creates 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
-
-