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

public Class GenericSemanticValidatorHelper

extends Object
implements SemanticValidatorHelper
Class Inheritance
All Implemented Interfaces
org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper
Annotations
@SuppressWarnings:nls
Imports
java.util.ArrayList, .Collections, .List, .Map, org.eclipse.persistence.jpa.jpql.Assert, .ExpressionTools, .ITypeHelper, .JPQLQueryDeclaration, .SemanticValidatorHelper, org.eclipse.persistence.jpa.jpql.parser.AbstractExpressionVisitor, .Expression, .IdentificationVariable, .JPQLGrammar, .Join, .SimpleSelectStatement, org.eclipse.persistence.jpa.jpql.tools.model.JPQLQueryBuilderWrapper, org.eclipse.persistence.jpa.jpql.tools.resolver.Declaration, .DeclarationResolver, .Resolver, .StateFieldResolver, org.eclipse.persistence.jpa.jpql.tools.spi.IConstructor, .IEntity, .IManagedType, .IMapping, .IType, .ITypeDeclaration, org.eclipse.persistence.jpa.jpql.utility.CollectionTools

An implementation of SemanticValidatorHelper that uses JPQLQueryContext to return the required information and Hermes SPI.

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

Nested and Inner Type Summary

Modifier and TypeClass and Description
protected static class

Field Summary

Modifier and TypeField and Description
private GenericSemanticValidatorHelper.IdentificationVariableVisitor
private final JPQLQueryContext
queryContext

The context used to query information about the JPQL query.

private ITypeHelper
typeHelper

The concrete instance of ITypeHelper that simply wraps TypeHelper.

Constructor Summary

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

Creates a new GenericSemanticValidatorHelper.

Method Summary

Modifier and TypeMethod and Description
protected void
addIdentificationVariable(IdentificationVariable identificationVariable, Map<String, List<IdentificationVariable>> identificationVariables)

protected GenericSemanticValidatorHelper.IdentificationVariableVisitor
public void
collectAllDeclarationIdentificationVariables(Map<String, List<IdentificationVariable>>
The Map used to store the variables
identificationVariables
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.collectAllDeclarationIdentificationVariables.

Collects the identification variables that are defined in the FROM clause of the current query and from the parent queries.
protected void
public void
collectLocalDeclarationIdentificationVariables(Map<String, List<IdentificationVariable>>
The Map used to store the variables
identificationVariables
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.collectLocalDeclarationIdentificationVariables.

Collects the identification variables that are defined in the FROM clause of the current query.
public void
disposeSubqueryContext()

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.disposeSubqueryContext.

Disposes this context, which is the current context being used by a subquery.
public String[]
entityNames()

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.entityNames.

Returns the name of the all entities that are present in the context of a persistence unit.
public List<JPQLQueryDeclaration>
getAllDeclarations()

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getAllDeclarations.

Returns the ordered list of JPQLQueryDeclaration, which contain the information contained in the query's FROM clause.
public IConstructor[]
getConstructors(Object type)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getConstructors.

Returns the constructors for the given type.
public List<JPQLQueryDeclaration>
getDeclarations()

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getDeclarations.

Returns the ordered list of JPQLQueryDeclaration, which contain the information contained in the query's FROM clause.
public IManagedType
getEmbeddable(Object
The Java type of the embeddable to retrieve
type
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getEmbeddable.

Retrieves the embeddable with the given type.
public IEntity
getEntityNamed(String
The abstract schema name of the entity to retrieve
entityName
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getEntityNamed.

Retrieves the entity with the given entity name.
public String[]
getEnumConstants(Object
The Enum type
type
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getEnumConstants.

Returns the constant names for the given Enum type.
public JPQLGrammar
getGrammar()

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getGrammar.

Returns the JPQLGrammar that defines how the JPQL query was parsed.
protected IdentificationVariable
protected GenericSemanticValidatorHelper.IdentificationVariableVisitor
public IManagedType
getManagedType(Expression expression)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getManagedType.

Returns the managed type by resolving the given Expression.
public IMapping
getMappingNamed(Object
The managed type that has a mapping with the given name
managedType
,
String
The name of the mapping to retrieve
path
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getMappingNamed.

Returns the mapping with the given name.
public IType
getMappingType(Object
The mapping object
mapping
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getMappingType.

Returns the type of the given mapping object.
public ITypeDeclaration[]
getMethodParameterTypeDeclarations(Object
The constructor to return its parameter types
constructor
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getMethodParameterTypeDeclarations.

Returns the list of type declarations representing the given constructor's parameter types.
public JPQLQueryContext

Returns:

The context used to query information about the JPQL query
getQueryContext
()

Returns the context used to query information about the JPQL query.

public IManagedType
getReferenceManagedType(Object
The relationship mapping
relationshipMapping
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getReferenceManagedType.

Returns the reference managed type from the given relationship mapping.
public IType
getType(Expression
The Expression to resolve
expression
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getType.

Returns the type by resolving the given Expression.
public IType
getType(Object typeDeclaration)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getType.

Returns the type defined for the Java member.
public IType
getType(String
The fully qualified name of the class to retrieve
typeName
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getType.

Retrieves the class with the given fully qualified name.
public ITypeDeclaration
getTypeDeclaration(Expression
The Expression to resolve
expression
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getTypeDeclaration.

Returns the type declaration for the given Expression's type.
public ITypeHelper
getTypeHelper()

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getTypeHelper.

Returns the helper that gives access to the most common class metadata.
public String
getTypeName(Object
The type to retrieve its name
type
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.getTypeName.

Returns the fully qualified class name of the given type.
public boolean
isAssignableTo(Object
The type to check if it is an instance of type 2
type1
,
Object
The type used to determine if the class represented by type 1 is an instance of with one
type2
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isAssignableTo.

Determines whether type 1 is an instance of type 2.
public boolean
isCollectionIdentificationVariable(String
The identification variable to check for what it maps
variableName
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isCollectionIdentificationVariable.

Determines whether the given identification variable is defining a join or a collection member declaration expressions.
public boolean
isCollectionMapping(Object
The mapping object to verify if it represents a collection mapping
mapping
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isCollectionMapping.

Determines whether the given mapping is a collection type mapping.
public boolean
isEmbeddableMapping(Object
The mapping object to verify if it represents an embeddable mapping
mapping
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isEmbeddableMapping.

Determines whether the given mapping is an embeddable type mapping.
public boolean
isEnumType(Object type)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isEnumType.

Determines whether the given type represents an Enum.
public boolean
isIdentificationVariableValidInComparison(IdentificationVariable
The IdentificationVariable that is mapped to either an entity, a singled-object value field, a collection-valued object field
expression
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isIdentificationVariableValidInComparison.

Determines whether an identification variable can be used in a comparison expression when the operator is either '<', '<=', '>', '>='.
public boolean
isManagedTypeResolvable(Object managedType)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isManagedTypeResolvable.

Determines whether the given managed type actually exists.
public boolean
isPropertyMapping(Object
The mapping object to verify if it represents a property mapping
mapping
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isPropertyMapping.

Determines whether the given mapping is a property type mapping.
public boolean
isRelationshipMapping(Object
The mapping object to verify if it represents a relationship mapping
mapping
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isRelationshipMapping.

Determines whether the given mapping is a relationship type mapping.
public boolean
isResultVariable(String
The variable to check if it's a result variable
variableName
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isResultVariable.

Determines if the given variable is a result variable.
public boolean
isTransient(Object
The mapping object to verify if it represents a transient attribute
mapping
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isTransient.

Determines whether the given mapping is a transient attribute.
public boolean
isTypeDeclarationAssignableTo(Object
The type declaration to check if it is an instance of type declaration 2
typeDeclaration1
,
Object
The type used to determine if the class represented by type declaration 1 is an instance of with one
typeDeclaration2
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isTypeDeclarationAssignableTo.

Determines whether type declaration 1 is an instance of type declaration 2.
public boolean
isTypeResolvable(Object type)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.isTypeResolvable.

Determines whether the given type actually exists.
public void
newSubqueryContext(SimpleSelectStatement
The parsed tree representation of the subquery that will become the current query
expression
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.newSubqueryContext.

Changes the state of this helper to use the given subquery.
public IMapping
resolveMapping(Expression
The Expression representing a state field path expression or a collection-valued path expression
expression
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.resolveMapping.

Returns the mapping for the field represented by the given Expression.
public IMapping
resolveMapping(String
The identification variable that is defined in the FROM clause of the query (which can be in the current subquery) or in one of the parent queries.
variableName
,
String
The name of the persistent field to retrieve
name
)

Implements org.eclipse.persistence.jpa.jpql.SemanticValidatorHelper.resolveMapping.

Returns the mapping that should be a persistence field from the entity defined by the given identification variable.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait