Class FromSubqueryResolver
- java.lang.Object
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
-
- org.eclipse.persistence.jpa.jpql.tools.resolver.FromSubqueryResolver
-
public class FromSubqueryResolver extends Resolver
ThisResolver
wraps a subquery that is used as the "root" object in a query's declaration.Example:
SELECT e.firstName FROM Employee e, (SELECT count(e2), e2.firstName FROM Employee e2) e3 WHERE e.firstName = e3.firstName
- Version:
- 2.5
- Author:
- Pascal Filion
- Since:
- 2.4
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected class
FromSubqueryResolver.VirtualManagedType
ThisIManagedType
represents a virtual managed type where its content will be derived from the subquery.protected static class
FromSubqueryResolver.VirtualMapping
This virtualIMapping
wraps one of the select items.protected class
FromSubqueryResolver.VirtualMappingBuilder
This visitor will traverse theSELECT
clause and create virtual mappings for the state field path expressions and any expression aliased with a result variable.
-
Constructor Summary
Constructors Constructor Description FromSubqueryResolver(Resolver parent, JPQLQueryContext queryContext, SimpleSelectStatement subquery)
Creates a newFromSubqueryResolver
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IType
buildType()
protected ITypeDeclaration
buildTypeDeclaration()
Resolves theITypeDeclaration
of the property handled by thisResolver
.IManagedType
getManagedType()
Returns theIManagedType
associated with the field handled by thisResolver
.-
Methods inherited from class org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
addChild, checkParent, getChild, getMapping, getParent, getParentManagedType, getParentMapping, getParentType, getParentTypeDeclaration, getProvider, getQuery, getType, getType, getType, getTypeDeclaration, getTypeHelper, getTypeRepository, isNullAllowed, setNullAllowed
-
-
-
-
Constructor Detail
-
FromSubqueryResolver
public FromSubqueryResolver(Resolver parent, JPQLQueryContext queryContext, SimpleSelectStatement subquery)
Creates a newFromSubqueryResolver
.- Parameters:
parent
- The parent of this resolver, which is nevernull
queryContext
- The context used to query information about the application metadata and cached informationsubquery
-- Throws:
java.lang.NullPointerException
- If the parent isnull
-
-
Method Detail
-
buildType
protected IType buildType()
-
buildTypeDeclaration
protected ITypeDeclaration buildTypeDeclaration()
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
-
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
-
-