public class AliasResolutionContextImpl extends Object implements AliasResolutionContext
Constructor and Description |
---|
AliasResolutionContextImpl(SessionFactoryImplementor sessionFactory)
Constructs a
AliasResolutionContextImpl without any source aliases. |
AliasResolutionContextImpl(SessionFactoryImplementor sessionFactory,
int suffixSeed)
Constructs a AliasResolutionContextImpl with the specified seed for unique alias suffixes.
|
Modifier and Type | Method and Description |
---|---|
void |
dumpResolutions(LoadPlan loadPlan)
USes its defined logger to generate a resolution report.
|
CollectionReferenceAliases |
generateCollectionReferenceAliases(String collectionQuerySpaceUid,
CollectionPersister persister,
String elementQuerySpaceUid)
Generate the collection reference aliases for a particular
CollectionReference
and register the generated value using the query space UID. |
EntityReferenceAliases |
generateEntityReferenceAliases(String uid,
EntityPersister entityPersister)
Generate the entity reference aliases for a particular
EntityReference
and register the generated value using the query space UID. |
void |
registerCompositeQuerySpaceUidResolution(String rightHandSideUid,
String leftHandSideTableAlias) |
CollectionReferenceAliases |
resolveCollectionReferenceAliases(String querySpaceUid)
Resolve the given QuerySpace UID to the CollectionReferenceAliases representing the SQL aliases used in
building the SQL query.
|
EntityReferenceAliases |
resolveEntityReferenceAliases(String querySpaceUid)
Resolve the given QuerySpace UID to the EntityReferenceAliases representing the SQL aliases used in
building the SQL query.
|
String |
resolveSqlTableAliasFromQuerySpaceUid(String querySpaceUid) |
protected SessionFactoryImplementor |
sessionFactory() |
public AliasResolutionContextImpl(SessionFactoryImplementor sessionFactory)
AliasResolutionContextImpl
without any source aliases. This form is used in
non-query contexts. Example of query contexts are: HQL, criteria, etc.sessionFactory
- The session factorypublic AliasResolutionContextImpl(SessionFactoryImplementor sessionFactory, int suffixSeed)
sessionFactory
- The session factorysuffixSeed
- The seed value to use for generating the suffix used when generating SQL aliases.protected SessionFactoryImplementor sessionFactory()
public EntityReferenceAliases generateEntityReferenceAliases(String uid, EntityPersister entityPersister)
EntityReference
and register the generated value using the query space UID.
Once generated, there are two methods that can be used to do look ups by the specified
query space UID:
resolveEntityReferenceAliases(String)
can be used to
look up the returned entity reference aliases;
resolveSqlTableAliasFromQuerySpaceUid(String)
can be used to
look up SQL table alias.
uid
- The query space UID for the entity reference.entityPersister
- The entity persister for entity reference.EntityReference.getQuerySpaceUid()
,
EntityReference.getEntityPersister()
public CollectionReferenceAliases generateCollectionReferenceAliases(String collectionQuerySpaceUid, CollectionPersister persister, String elementQuerySpaceUid)
CollectionReference
and register the generated value using the query space UID.
Once generated, there are two methods that can be used to do look ups by the specified
query space UID:
##resolveCollectionReferenceAliases(String)
can be used to
look up the returned collection reference aliases;
resolveSqlTableAliasFromQuerySpaceUid(String)
can be used to
look up the SQL collection table alias.
collectionQuerySpaceUid
- The query space UID for the collection reference.persister
- The collection persister for collection reference.elementQuerySpaceUid
- The query space UID for the collection element if
the element is an entity type; null, otherwise.IllegalArgumentException
- if the collection element is an entity type and
elementQuerySpaceUid
is null.CollectionReference.getQuerySpaceUid()
,
CollectionReference.getCollectionPersister()
public String resolveSqlTableAliasFromQuerySpaceUid(String querySpaceUid)
resolveSqlTableAliasFromQuerySpaceUid
in interface AliasResolutionContext
public EntityReferenceAliases resolveEntityReferenceAliases(String querySpaceUid)
AliasResolutionContext
null
if
no QuerySpace with that UID has yet been resolved in the context.resolveEntityReferenceAliases
in interface AliasResolutionContext
querySpaceUid
- The QuerySpace UID whose EntityReferenceAliases we want to look up.null
.public CollectionReferenceAliases resolveCollectionReferenceAliases(String querySpaceUid)
AliasResolutionContext
null
if
no QuerySpace with that UID has yet been resolved in the context.resolveCollectionReferenceAliases
in interface AliasResolutionContext
querySpaceUid
- The QuerySpace UID whose CollectionReferenceAliases we want to look up.null
.public void registerCompositeQuerySpaceUidResolution(String rightHandSideUid, String leftHandSideTableAlias)
public void dumpResolutions(LoadPlan loadPlan)
loadPlan
- The loadplan that was processed.Copyright © 2016 JBoss by Red Hat. All rights reserved.