Class SubqueryEntityResolver
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.SubqueryEntityResolver
-
public class SubqueryEntityResolver extends Resolver
ThisResolver
retrieves the type for an abstract schema name (entity name) if it can be resolved otherwise a derived path will be assumed. ThisResolver
is used within a subquery and it handles the following two cases.The "root" object in the subquery is an unqualified derived path:
and The "root" object in the subquery is an entity:UPDATE Employee SET name = 'JPQL' WHERE (SELECT a FROM addr a)
UPDATE Employee SET name = 'JPQL' WHERE (SELECT a FROM Address a)
- Since:
- 2.5
- Version:
- 2.5
- Author:
- Pascal Filion
-
-
Constructor Summary
Constructors Constructor Description SubqueryEntityResolver(Resolver parent, JPQLQueryContext queryContext, AbstractSchemaName abstractSchemaName)
Creates a newDerivedPathResolver
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAbstractSchemaName()
Returns the name of the entity to resolve.IManagedType
getManagedType()
Returns theIManagedType
associated with the field handled by thisResolver
.IMapping
getMapping()
Returns theIMapping
for the wrapped field.java.lang.String
toString()
-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
addChild, getChild, getParent, getParentManagedType, getParentMapping, getParentType, getParentTypeDeclaration, getProvider, getQuery, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isNullAllowed, setNullAllowed
-
-
-
-
Constructor Detail
-
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 Detail
-
getAbstractSchemaName
public java.lang.String getAbstractSchemaName()
Returns the name of the entity to resolve.- Returns:
- The entity name, which is never
null
-
getManagedType
public IManagedType getManagedType()
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
public IMapping getMapping()
Returns theIMapping
for the wrapped field.- Overrides:
getMapping
in classResolver
- Returns:
- Either the
IMapping
ornull
if none exists
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-