Top Description Constructors Methods
org.eclipse.persistence.jpa.jpql.tools

public Class EclipseLinkSemanticValidator

extends AbstractEclipseLinkSemanticValidator
Class Inheritance
Imports
org.eclipse.persistence.jpa.jpql.AbstractEclipseLinkSemanticValidator, .EclipseLinkSemanticValidatorExtension, .SemanticValidatorHelper

This validator is responsible to gather the problems found in a JPQL query by validating the content to make sure it is semantically valid for EclipseLink. The grammar is not validated by this visitor.

For instance, the function AVG accepts a state field path. The property it represents has to be of numeric type. AVG(e.name) is parsable but is not semantically valid because the type of name is a string (the property signature is: "private String name").

Note

EclipseLink does not validate types, but leaves it to the database. This is because some databases such as Oracle allow different types to different functions and perform implicit type conversion. i.e. CONCAT('test', 2) returns 'test2'. Also the FUNC function has an unknown type, so should be allowed with any function.

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
EclipseLinkGrammarValidator

Constructor Summary

AccessConstructor and Description
public
EclipseLinkSemanticValidator(JPQLQueryContext
The context used to query information about the JPQL query
queryContext
)

Creates a new EclipseLinkSemanticValidator.
public
EclipseLinkSemanticValidator(JPQLQueryContext
The context used to query information about the JPQL query
queryContext
,
EclipseLinkSemanticValidatorExtension
The following extension can be used to give access to non-JPA metadata artifacts, such as database tables and columns
extension
)

Creates a new EclipseLinkSemanticValidator.

public
EclipseLinkSemanticValidator(SemanticValidatorHelper
The given helper allows this validator to access the JPA artifacts without using Hermes SPI
helper
,
EclipseLinkSemanticValidatorExtension
The following extension can be used to give access to non-JPA metadata artifacts, such as database tables and columns
extension
)

Creates a new EclipseLinkSemanticValidator.

Method Summary

Inherited from org.eclipse.persistence.jpa.jpql.AbstractEclipseLinkSemanticValidator:
buildLiteralVisitorbuildOwningClauseVisitorbuildSubquerySelectItemCalculatorbuildTableExpressionVisitorbuildTopLevelFirstDeclarationVisitorgetDeclarationgetExtensiongetSubquerySelectItemCalculatorgetTableExpressionVisitorisTableExpressionselectClausePathExpressionPathTypesubquerySelectItemCountvalidateFunctionExpressionvalidateInExpressionvalidateRangeVariableDeclarationRootObjectvalidateThirdPartyStateFieldPathExpressionvalidPathExpressionTypeForCountFunctionvalidPathExpressionTypeForInExpressionvalidPathExpressionTypeForInItemvalidPathExpressionTypeForStringExpressionvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisitvisit

Constructor Detail

EclipseLinkSemanticValidatorback to summary
public EclipseLinkSemanticValidator(JPQLQueryContext queryContext)

Creates a new EclipseLinkSemanticValidator.

Parameters
queryContext:JPQLQueryContext

The context used to query information about the JPQL query

Annotations
@Deprecated
Exceptions
NullPointerException:
The given JPQLQueryContext cannot be null
EclipseLinkSemanticValidatorback to summary
public EclipseLinkSemanticValidator(JPQLQueryContext queryContext, EclipseLinkSemanticValidatorExtension extension)

Creates a new EclipseLinkSemanticValidator.

Parameters
queryContext:JPQLQueryContext

The context used to query information about the JPQL query

extension:EclipseLinkSemanticValidatorExtension

The following extension can be used to give access to non-JPA metadata artifacts, such as database tables and columns

Exceptions
NullPointerException:
The given JPQLQueryContext cannot be null
EclipseLinkSemanticValidatorback to summary
public EclipseLinkSemanticValidator(SemanticValidatorHelper helper, EclipseLinkSemanticValidatorExtension extension)

Creates a new EclipseLinkSemanticValidator.

Parameters
helper:SemanticValidatorHelper

The given helper allows this validator to access the JPA artifacts without using Hermes SPI

extension:EclipseLinkSemanticValidatorExtension

The following extension can be used to give access to non-JPA metadata artifacts, such as database tables and columns

Exceptions
NullPointerException:
The given SemanticValidatorHelper cannot be null