Class FromSubqueryResolver
java.lang.Object
org.eclipse.persistence.jpa.jpql.tools.resolver.Resolver
org.eclipse.persistence.jpa.jpql.tools.resolver.FromSubqueryResolver
This
Resolver 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- Since:
- 2.4
- Version:
- 2.5
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected classThisIManagedTyperepresents a virtual managed type where its content will be derived from the subquery.protected static classThis virtualIMappingwraps one of the select items.protected classThis visitor will traverse theSELECTclause and create virtual mappings for the state field path expressions and any expression aliased with a result variable. -
Constructor Summary
ConstructorsConstructorDescriptionFromSubqueryResolver(Resolver parent, JPQLQueryContext queryContext, SimpleSelectStatement subquery) Creates a newFromSubqueryResolver. -
Method Summary
Modifier and TypeMethodDescriptionprotected ITypeprotected ITypeDeclarationResolves theITypeDeclarationof the property handled by thisResolver.Returns theIManagedTypeassociated 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 Details
-
FromSubqueryResolver
public FromSubqueryResolver(Resolver parent, JPQLQueryContext queryContext, SimpleSelectStatement subquery) Creates a newFromSubqueryResolver.- Parameters:
parent- The parent of this resolver, which is nevernullqueryContext- The context used to query information about the application metadata and cached information- Throws:
NullPointerException- If the parent isnull
-
-
Method Details
-
buildType
Description copied from class:Resolver -
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
-
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
-