Package org.hibernate.loader.plan.spi
Interface LoadPlan
-
public interface LoadPlanDescribes a plan for performing a load of results. Generally speaking there are 3 forms of load plans:-
LoadPlan.Disposition.ENTITY_LOADER- An entity load plan for handling get/load handling. This form will typically have a single return (of typeEntityReturn) defined bygetReturns(), possibly defining fetches. -
LoadPlan.Disposition.COLLECTION_INITIALIZER- A collection initializer, used to load the contents of a collection. This form will typically have a single return (of typeCollectionReturn) defined bygetReturns(), possibly defining fetches -
LoadPlan.Disposition.MIXED- A query load plan which can contain multiple returns of mixed type (though all implementingReturn). Again, may possibly define fetches.
- follow-on locking
- join fetch conversions to subselect fetches
-
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classLoadPlan.DispositionEnumerated possibilities for describing the disposition of this LoadPlan.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleanareLazyAttributesForceFetched()Does this load plan indicate that lazy attributes are to be force fetched?LoadPlan.DispositiongetDisposition()What is the disposition of this LoadPlan, in terms of its returns.QuerySpacesgetQuerySpaces()Gets theQuerySpacesfor the load plan, which contains aQuerySpacereference for each non-scalar return and for each entity, collection, and compositeFetchSource.java.util.List<? extends Return>getReturns()Get the returns indicated by this LoadPlan. ALoadPlan.Disposition.ENTITY_LOADERLoadPlan would have just a single Return of typeEntityReturn.booleanhasAnyScalarReturns()Convenient form of checkinggetReturns()for scalar root returns.
-
-
-
Method Detail
-
getDisposition
LoadPlan.Disposition getDisposition()
What is the disposition of this LoadPlan, in terms of its returns.- Returns:
- The LoadPlan's disposition
-
getReturns
java.util.List<? extends Return> getReturns()
Get the returns indicated by this LoadPlan.-
A
LoadPlan.Disposition.ENTITY_LOADERLoadPlan would have just a single Return of typeEntityReturn. -
A
LoadPlan.Disposition.COLLECTION_INITIALIZERLoadPlan would have just a single Return of typeCollectionReturn. -
A
LoadPlan.Disposition.MIXEDLoadPlan would contain a mix ofEntityReturnandScalarReturnelements, but noCollectionReturn.
- Returns:
- The Returns for this LoadPlan.
- See Also:
LoadPlan.Disposition
-
A
-
getQuerySpaces
QuerySpaces getQuerySpaces()
Gets theQuerySpacesfor the load plan, which contains aQuerySpacereference for each non-scalar return and for each entity, collection, and compositeFetchSource. When generating SQL, the query spaces provide data for the "from clause" including joins.- Returns:
- The QuerySpaces
-
areLazyAttributesForceFetched
boolean areLazyAttributesForceFetched()
Does this load plan indicate that lazy attributes are to be force fetched? Here we are talking about laziness in regards to the legacy bytecode enhancement which adds support for partial selects of an entity's state (e.g., skip loading a lob initially, wait until/if it is needed) This one would effect the SQL that needs to get generated as well as how the result set would be read. Therefore we make this part of the LoadPlan contract. NOTE that currently this is only relevant for HQL loaders when the HQL has specified theFETCH ALL PROPERTIESkey-phrase. In all other cases, this returns false.- Returns:
- Whether or not to
-
hasAnyScalarReturns
boolean hasAnyScalarReturns()
Convenient form of checkinggetReturns()for scalar root returns.- Returns:
trueifgetReturns()contained any scalar returns;falseotherwise.
-
-