public interface LoadPlan
Describes a plan for performing a load of results.
Generally speaking there are 3 forms of load plans:<ul>
<li>
LoadPlan.Disposition.ENTITY_LOADER - An entity load plan for
handling get/load handling. This form will typically have a single return (of type EntityReturn)
defined by getReturns(), possibly defining fetches.
</li>
<li>
LoadPlan.Disposition.COLLECTION_INITIALIZER - A collection initializer,
used to load the contents of a collection. This form will typically have a single return (of
type CollectionReturn) defined by getReturns(), possibly defining fetches
</li>
<li>
LoadPlan.Disposition.MIXED - A query load plan which can contain
multiple returns of mixed type (though all implementing Return). Again, may possibly define fetches.
</li>
</ul>
<p/>
todo : would also like to see "call back" style access for handling "subsequent actions" such as…<ul>
<li>follow-on locking</li>
<li>join fetch conversions to subselect fetches</li>
</ul>
| Modifier and Type | Interface and Description |
|---|---|
static class |
LoadPlan.Disposition
Enumerated possibilities for describing the disposition of this LoadPlan.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
areLazyAttributesForceFetched()
Does this load plan indicate that lazy attributes are to be force fetched?
<p/>
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)
<p/>
This one would effect the SQL that needs to get generated as well as how the result set would be read.
|
LoadPlan.Disposition |
getDisposition()
What is the disposition of this LoadPlan, in terms of its returns.
|
QuerySpaces |
getQuerySpaces()
Gets the
QuerySpaces for the load plan, which contains a QuerySpace
reference for each non-scalar return and for each entity, collection, and composite
FetchSource. |
List<? extends Return> |
getReturns()
Get the returns indicated by this LoadPlan.<ul>
<li>
A
LoadPlan.Disposition.ENTITY_LOADER LoadPlan would have just a single Return of type EntityReturn. |
boolean |
hasAnyScalarReturns()
Convenient form of checking
getReturns() for scalar root returns. |
LoadPlan.Disposition getDisposition()
What is the disposition of this LoadPlan, in terms of its returns.
List<? extends Return> getReturns()
Get the returns indicated by this LoadPlan.<ul>
<li>
A LoadPlan.Disposition.ENTITY_LOADER LoadPlan would have just a single Return of type EntityReturn.
</li>
<li>
A LoadPlan.Disposition.COLLECTION_INITIALIZER LoadPlan would have just a single Return of type
CollectionReturn.
</li>
<li>
A LoadPlan.Disposition.MIXED LoadPlan would contain a mix of EntityReturn and
ScalarReturn elements, but no CollectionReturn.
</li>
</ul>
<p/>
When generating SQL, the Returns provide columns/formulas used in the "select clause".
LoadPlan.DispositionQuerySpaces getQuerySpaces()
Gets the QuerySpaces for the load plan, which contains a QuerySpace
reference for each non-scalar return and for each entity, collection, and composite
FetchSource.
<p/>
When generating SQL, the query spaces provide data for the "from clause" including joins.
boolean areLazyAttributesForceFetched()
Does this load plan indicate that lazy attributes are to be force fetched?
<p/>
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)
<p/>
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.
<p/>
NOTE that currently this is only relevant for HQL loaders when the HQL has specified the FETCH ALL PROPERTIES
key-phrase. In all other cases, this returns false.
boolean hasAnyScalarReturns()
Convenient form of checking getReturns() for scalar root returns.
true if getReturns() contained any scalar returns; false otherwise.Copyright © 2001-2018 Red Hat, Inc. All Rights Reserved.