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
ThisResolverretrieves the type for an abstract schema name (entity name) if it can be resolved otherwise a derived path will be assumed. ThisResolveris 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 protected ITypebuildType()protected ITypeDeclarationbuildTypeDeclaration()Resolves theITypeDeclarationof the property handled by thisResolver.StringgetAbstractSchemaName()Returns the name of the entity to resolve.IManagedTypegetManagedType()Returns theIManagedTypeassociated with the field handled by thisResolver.IMappinggetMapping()Returns theIMappingfor the wrapped field.protected ResolverresolveDerivePathResolver()Creates theResolverfor a unqualified derived path expression.StringtoString()-
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 Detail
-
SubqueryEntityResolver
public SubqueryEntityResolver(Resolver parent, JPQLQueryContext queryContext, AbstractSchemaName abstractSchemaName)
Creates a newDerivedPathResolver.- Parameters:
parent- The parentResolver, which is nevernullqueryContext- TheJPQLQueryContextfor the subqueryabstractSchemaName- TheAbstractSchemaNameholding onto the the name of the entity
-
-
Method Detail
-
buildTypeDeclaration
protected ITypeDeclaration buildTypeDeclaration()
Description copied from class:ResolverResolves theITypeDeclarationof the property handled by thisResolver.- Specified by:
buildTypeDeclarationin classResolver- Returns:
- Either the
ITypeDeclarationthat was resolved by thisResolveror theITypeDeclarationforIType.UNRESOLVABLE_TYPEif it could not be resolved
-
getAbstractSchemaName
public String getAbstractSchemaName()
Returns the name of the entity to resolve.- Returns:
- The entity name, which is never
null
-
getManagedType
public IManagedType getManagedType()
Description copied from class:ResolverReturns theIManagedTypeassociated with the field handled by thisResolver. If thisResolverdoes not handle a field that has aIManagedType, thennullshould be returned.For example: "
SELECT e FROM Employee e", theResolverfor e would be returning theIManagedTypefor Employee.- Overrides:
getManagedTypein classResolver- Returns:
- Either the
IManagedType, if it could be resolved;nullotherwise
-
getMapping
public IMapping getMapping()
Description copied from class:ResolverReturns theIMappingfor the wrapped field.- Overrides:
getMappingin classResolver- Returns:
- Either the
IMappingornullif none exists
-
resolveDerivePathResolver
protected Resolver resolveDerivePathResolver()
Creates theResolverfor a unqualified derived path expression.- Returns:
- A non-
nullResolver
-
-