Package org.hibernate.loader.plan.spi
Interface BidirectionalEntityReference
-
- All Superinterfaces:
EntityReference,FetchSource
public interface BidirectionalEntityReference extends EntityReference
Represents the circular side of a bi-directional entity association. Wraps a reference to the associated (target) EntityReference. TheEntityReferenceAliasesfor this object is the same as for its target EntityReference, and can be looked up viaAliasResolutionContext.resolveEntityReferenceAliases(String)using the value returned bygetQuerySpaceUid(). This relies on reference lookups against the EntityReference instances, therefore this allows representation of the circularity but with a little protection against potential stack overflows. This is unfortunately still a cyclic graph. An alternative approach is to make the graph acyclic (DAG) would be to follow the process I adopted in the original HQL Antlr v3 work with regard to always applying an alias to the "persister reference", even where that meant creating a generated, unique identifier as the alias. That allows other parts of the tree to refer to the "persister reference" by that alias without the need for potentially cyclic graphs (think ALIAS_REF in the current ORM parser). Those aliases can then be mapped/catalogued against the "persister reference" for retrieval as needed.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetQuerySpaceUid()The query space UID returned usinggetQuerySpaceUid()must be the same as returned bygetTargetEntityReference()EntityReferencegetTargetEntityReference()Get the targeted EntityReference-
Methods inherited from interface org.hibernate.loader.plan.spi.EntityReference
getEntityPersister, getIdentifierDescription
-
Methods inherited from interface org.hibernate.loader.plan.spi.FetchSource
getBidirectionalEntityReferences, getFetches, getPropertyPath, resolveEntityReference
-
-
-
-
Method Detail
-
getTargetEntityReference
EntityReference getTargetEntityReference()
Get the targeted EntityReference- Returns:
- The targeted EntityReference
-
getQuerySpaceUid
java.lang.String getQuerySpaceUid()
The query space UID returned usinggetQuerySpaceUid()must be the same as returned bygetTargetEntityReference()- Specified by:
getQuerySpaceUidin interfaceEntityReference- Specified by:
getQuerySpaceUidin interfaceFetchSource- Returns:
- The query space UID.
-
-