Package org.eclipse.persistence.queries
Interface JPAQueryBuilder
-
- All Known Implementing Classes:
ANTLRQueryBuilder
public interface JPAQueryBuilderThis interface defines the entry point for implementing a JPQL query parsing system in EclipseLink.By default, EclipseLink uses
HermesParserfor parsing a query and converting it into aDatabaseQuery.Third-parties can implement this interface and provide a different JPQL parsing system if required. The
JPAQueryBuilderimplementing class can be registered via a persistence unit property and the implementation class must have a public, zero-arg constructor.- Version:
- 2.4
- Author:
- John Bracken, Pascal Filion
- Since:
- 2.2
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description DatabaseQuerybuildQuery(java.lang.CharSequence jpqlQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)Creates a fully initializedDatabaseQueryby parsing the given JPQL query.ExpressionbuildSelectionCriteria(java.lang.String entityName, java.lang.String selectionCriteria, org.eclipse.persistence.internal.sessions.AbstractSession session)Creates a newExpressionthat represents the given selection criteria.voidpopulateQuery(java.lang.CharSequence jpqlQuery, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)Populates the givenDatabaseQueryby parsing the given JPQL query.voidsetValidationLevel(java.lang.String level)Allow the parser validation level to be set.
-
-
-
Method Detail
-
setValidationLevel
void setValidationLevel(java.lang.String level)
Allow the parser validation level to be set.- Parameters:
level- The validation levels are defined in ParserValidationType
-
buildQuery
DatabaseQuery buildQuery(java.lang.CharSequence jpqlQuery, org.eclipse.persistence.internal.sessions.AbstractSession session)
Creates a fully initializedDatabaseQueryby parsing the given JPQL query.- Parameters:
jpqlQuery- A non-nullstring representation of the query to parse and to convert into aDatabaseQuerysession- The EclipseLinkAbstractSessionthat this query will execute against- Returns:
- The fully initialized
DatabaseQuery
-
buildSelectionCriteria
Expression buildSelectionCriteria(java.lang.String entityName, java.lang.String selectionCriteria, org.eclipse.persistence.internal.sessions.AbstractSession session)
Creates a newExpressionthat represents the given selection criteria.- Parameters:
entityName- The name of the entity for which a criteria is createdselectionCriteria- The string representation of a conditional expression to parsesession- The EclipseLinkAbstractSessionthat this query will execute against- Returns:
- The fully initialized
Expression
-
populateQuery
void populateQuery(java.lang.CharSequence jpqlQuery, DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)Populates the givenDatabaseQueryby parsing the given JPQL query.- Parameters:
jpqlQuery- A non-nullstring representation of the query to parse and to convert into aDatabaseQueryquery- The query to populate with the derived JPQL querysession- The EclipseLinkAbstractSessionthat this query will execute against
-
-