DatabaseQuery. If validation is not turned off,
then the JPQL query will be validated based on the grammar related to the validation level and
will also be validated based on the semantic (context).
The validation level determines how to validate the JPQL query. It checks if any specific feature is allowed. For instance, if the JPQL query has functions defined for EclipseLink grammar but the validation level is set for generic JPA, then an exception will be thrown indicating the function cannot be used.
JPQLExpression
| Modifier and Type | Class and Description |
|---|---|
| private static class | HermesParser.DatabaseQueryVisitor
This visitor traverses the parsed tree and create the right EclipseLink query and populates it. |
| Modifier and Type | Field and Description |
|---|---|
| private String | validationLevel
Determines how to validate the JPQL query grammatically. |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| private void | addArguments(JPQLQueryContext
The queryContext, DatabaseQuery JPQLQueryContext containing the information about the JPQL queryThe EclipseLink databaseQuery)DatabaseQuery where the input parameter types are addedRegisters the input parameters derived from the JPQL expression with the |
| private JPQLException | Returns: TheJPQLException indicating the problems with the JPQL queryThe queryContext, Collection<JPQLQueryProblem> JPQLQueryContext containing the information about the JPQL queryThe problems, String problems found in the JPQL query that are
translated into an exceptionThe key used to retrieve the localized message messageKey)Creates a |
| public DatabaseQuery | buildQuery(CharSequence
A non- jpqlQuery, AbstractSession null string representation of the query to
parse and to convert into a DatabaseQueryThe EclipseLink session)AbstractSession that this query will
execute againstImplements org. DatabaseQuery by parsing the given
JPQL query.
|
| public Expression | buildSelectionCriteria(String
The name of the entity for which a criteria is created entityName, String The string representation of a conditional expression to parse selectionCriteria, AbstractSession The EclipseLink session)AbstractSession that this query will
execute againstImplements org. Expression that represents the given selection
criteria.
|
| private JPQLException | |
| private boolean | Returns: true if the query might be incomplete or invalid; false if
the query is complete and grammatically validDetermines whether the JPQL query should be parsed with tolerance turned on or off, i.e. if validation is turned off, then it's assumed the JPQL query is grammatically valid and complete. |
| private JPQLGrammar | Returns: TheJPQLGrammar written for a specific JPA version or for the current version
of EclipseLinkReturns the |
| public void | populateQuery(CharSequence
A non- jpqlQuery, DatabaseQuery null string representation of the query to
parse and to convert into a DatabaseQueryThe query to populate with the derived JPQL query query, AbstractSession The EclipseLink session)AbstractSession that this query will
execute againstImplements org. DatabaseQuery by parsing the given JPQL
query.
|
| private DatabaseQuery | |
| private ResourceBundle | |
| public void | setValidationLevel(String
The validation levels are defined in ParserValidationType validationLevel)Implements org. |
| private void | validate(JPQLQueryContext
The context used to query information about the application metadata and
cached information queryContext, Expression The expression)Expression to
validate grammatically and semanticallyGrammatically and semantically validates the JPQL query. |
| validationLevel | back to summary |
|---|---|
| private String validationLevel Determines how to validate the JPQL query grammatically. | |
| HermesParser | back to summary |
|---|---|
| public HermesParser() Creates a new | |
| addArguments | back to summary |
|---|---|
| private void addArguments(JPQLQueryContext queryContext, DatabaseQuery databaseQuery) Registers the input parameters derived from the JPQL expression with the
| |
| buildException | back to summary |
|---|---|
| private JPQLException buildException(JPQLQueryContext queryContext, Collection<JPQLQueryProblem> problems, String messageKey) Creates a
| |
| buildQuery | back to summary |
|---|---|
| public DatabaseQuery buildQuery(CharSequence jpqlQuery, AbstractSession session) Implements org. Doc from org. Creates a fully initialized
| |
| buildSelectionCriteria | back to summary |
|---|---|
| public Expression buildSelectionCriteria(String entityName, String selectionCriteria, AbstractSession session) Implements org. Doc from org. Creates a new
| |
| buildUnexpectedException | back to summary |
|---|---|
| private JPQLException buildUnexpectedException(CharSequence jpqlQuery, Exception exception) | |
| isTolerant | back to summary |
|---|---|
| private boolean isTolerant() Determines whether the JPQL query should be parsed with tolerance turned on or off, i.e. if validation is turned off, then it's assumed the JPQL query is grammatically valid and complete. In this case, it will be parsed with tolerance turned off resulting in better performance.
| |
| jpqlGrammar | back to summary |
|---|---|
| private JPQLGrammar jpqlGrammar() Returns the
| |
| populateQuery | back to summary |
|---|---|
| public void populateQuery(CharSequence jpqlQuery, DatabaseQuery query, AbstractSession session) Implements org. Doc from org. Populates the given
| |
| populateQueryImp | back to summary |
|---|---|
| private DatabaseQuery populateQueryImp(CharSequence jpqlQuery, DatabaseQuery query, AbstractSession session) | |
| resourceBundle | back to summary |
|---|---|
| private ResourceBundle resourceBundle() | |
| setValidationLevel | back to summary |
|---|---|
| public void setValidationLevel(String validationLevel) Implements org. Doc from org. Allow the parser validation level to be set. | |
| validate | back to summary |
|---|---|
| private void validate(JPQLQueryContext queryContext, Expression expression) Grammatically and semantically validates the JPQL query. If the query is not valid, then an exception will be thrown.
| |
| Modifier and Type | Field and Description |
|---|---|
| private final String | |
| private final JPQLQueryContext |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| jpqlQuery | back to summary |
|---|---|
| private final String jpqlQuery | |
| queryContext | back to summary |
|---|---|
| private final JPQLQueryContext queryContext | |
| DatabaseQueryVisitor | back to summary |
|---|---|
| pack-priv DatabaseQueryVisitor(JPQLQueryContext queryContext, CharSequence jpqlQuery) | |
| buildReadAllQuery | back to summary |
|---|---|
| private ReadAllQuery buildReadAllQuery(SelectStatement expression) | |
| buildVisitor | back to summary |
|---|---|
| private AbstractObjectLevelReadQueryVisitor buildVisitor(ObjectLevelReadQuery query) | |
| visit | back to summary |
|---|---|
| public void visit(DeleteStatement expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(JPQLExpression expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(SelectStatement expression) Overrides org. Implements org. Doc from org. Visits the
| |
| visit | back to summary |
|---|---|
| public void visit(UpdateStatement expression) Overrides org. Implements org. Doc from org. Visits the
| |