Class SubqueryEntityResolver
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
org.eclipse.persistence.jpa.jpql.tools.resolver.SubqueryEntityResolver
This
Resolver
retrieves the type for an abstract schema name (entity name) if it can
be resolved otherwise a derived path will be assumed. This Resolver
is used within a
subquery and it handles the following two cases.
The "root" object in the subquery is an unqualified derived path:
UPDATE Employee SET name = 'JPQL'
WHERE (SELECT a FROM addr a)
and
The "root" object in the subquery is an entity:
UPDATE Employee SET name = 'JPQL'
WHERE (SELECT a FROM Address a)
- Since:
- 2.5
- Version:
- 2.5
-
Constructor Summary
ConstructorDescriptionSubqueryEntityResolver
(Resolver parent, JPQLQueryContext queryContext, AbstractSchemaName abstractSchemaName) Creates a newDerivedPathResolver
. -
Method Summary
Modifier and TypeMethodDescriptionprotected IType
protected ITypeDeclaration
Resolves theITypeDeclaration
of the property handled by thisResolver
.Returns the name of the entity to resolve.Returns theIManagedType
associated with the field handled by thisResolver
.Returns theIMapping
for the wrapped field.protected Resolver
Creates theResolver
for a unqualified derived path expression.toString()
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
addChild, checkParent, getChild, getParent, getParentManagedType, getParentMapping, getParentType, getParentTypeDeclaration, getProvider, getQuery, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isNullAllowed, setNullAllowed
-
Constructor Details
-
SubqueryEntityResolver
public SubqueryEntityResolver(Resolver parent, JPQLQueryContext queryContext, AbstractSchemaName abstractSchemaName) Creates a newDerivedPathResolver
.- Parameters:
parent
- The parentResolver
, which is nevernull
queryContext
- TheJPQLQueryContext
for the subqueryabstractSchemaName
- TheAbstractSchemaName
holding onto the the name of the entity
-
-
Method Details
-
buildType
Description copied from class:Resolver
-
buildTypeDeclaration
Description copied from class:Resolver
Resolves theITypeDeclaration
of the property handled by thisResolver
.- Specified by:
buildTypeDeclaration
in classResolver
- Returns:
- Either the
ITypeDeclaration
that was resolved by thisResolver
or theITypeDeclaration
forIType.UNRESOLVABLE_TYPE
if it could not be resolved
-
getAbstractSchemaName
Returns the name of the entity to resolve.- Returns:
- The entity name, which is never
null
-
getManagedType
Description copied from class:Resolver
Returns theIManagedType
associated with the field handled by thisResolver
. If thisResolver
does not handle a field that has aIManagedType
, thennull
should be returned.For example: "
SELECT e FROM Employee e
", theResolver
for e would be returning theIManagedType
for Employee.- Overrides:
getManagedType
in classResolver
- Returns:
- Either the
IManagedType
, if it could be resolved;null
otherwise
-
getMapping
Description copied from class:Resolver
Returns theIMapping
for the wrapped field.- Overrides:
getMapping
in classResolver
- Returns:
- Either the
IMapping
ornull
if none exists
-
resolveDerivePathResolver
Creates theResolver
for a unqualified derived path expression.- Returns:
- A non-
null
Resolver
-
toString
-