LoadPlan.Disposition
Modifier | Constructor and Description |
---|---|
|
LoadPlanImpl(CollectionReturn rootReturn,
QuerySpaces querySpaces)
Creates a
Disposition#COLLECTION_INITIALIZER LoadPlan. |
|
LoadPlanImpl(EntityReturn rootReturn,
QuerySpaces querySpaces)
Creates a
Disposition#ENTITY_LOADER LoadPlan. |
|
LoadPlanImpl(List<? extends Return> returns,
QuerySpaces querySpaces,
boolean areLazyAttributesForceFetched)
Creates a
Disposition#MIXED LoadPlan. |
protected |
LoadPlanImpl(List<? extends Return> returns,
QuerySpaces querySpaces,
LoadPlan.Disposition disposition,
boolean areLazyAttributesForceFetched) |
Modifier and Type | Method and Description |
---|---|
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.
|
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.
A
LoadPlan.Disposition.ENTITY_LOADER LoadPlan would have just a single Return of type EntityReturn . |
boolean |
hasAnyScalarReturns()
Convenient form of checking
LoadPlan.getReturns() for scalar root returns. |
protected LoadPlanImpl(List<? extends Return> returns, QuerySpaces querySpaces, LoadPlan.Disposition disposition, boolean areLazyAttributesForceFetched)
public LoadPlanImpl(EntityReturn rootReturn, QuerySpaces querySpaces)
Disposition#ENTITY_LOADER
LoadPlan.rootReturn
- The EntityReturn representation of the entity being loaded.querySpaces
- The QuerySpaces containing all the QuerySpace
references
required for rootReturn
and joined entity, collection,
and composite references.public LoadPlanImpl(CollectionReturn rootReturn, QuerySpaces querySpaces)
Disposition#COLLECTION_INITIALIZER
LoadPlan.rootReturn
- The CollectionReturn representation of the collection being initialized.querySpaces
- The QuerySpaces containing all the QuerySpace
references
required for rootReturn
and joined entity, collection,
and composite references.public LoadPlanImpl(List<? extends Return> returns, QuerySpaces querySpaces, boolean areLazyAttributesForceFetched)
Disposition#MIXED
LoadPlan.returns
- The mixed Return referencesquerySpaces
- The QuerySpaces containing all the QuerySpace
references
required for rootReturn
and joined entity, collection,
and composite references.areLazyAttributesForceFetched
- Should lazy attributes (bytecode enhanced laziness) be fetched also? This
effects the eventual SQL SELECT-clause which is why we have it here. Currently this is "all-or-none"; you
can request that all lazy properties across all entities in the loadplan be force fetched or none. There is
no entity-by-entity option. FETCH ALL PROPERTIES
is the way this is requested in HQL. Would be nice to
consider this entity-by-entity, as opposed to all-or-none. For example, "fetch the LOB value for the Item.image
attribute, but no others (leave them lazy)". Not too concerned about having it at the attribute level.public List<? extends Return> getReturns()
LoadPlan
LoadPlan.Disposition.ENTITY_LOADER
LoadPlan would have just a single Return of type EntityReturn
.
LoadPlan.Disposition.COLLECTION_INITIALIZER
LoadPlan would have just a single Return of type
CollectionReturn
.
LoadPlan.Disposition.MIXED
LoadPlan would contain a mix of EntityReturn
and
ScalarReturn
elements, but no CollectionReturn
.
getReturns
in interface LoadPlan
LoadPlan.Disposition
public QuerySpaces getQuerySpaces()
LoadPlan
QuerySpaces
for the load plan, which contains a QuerySpace
reference for each non-scalar return and for each entity, collection, and composite
FetchSource
.
When generating SQL, the query spaces provide data for the "from clause" including joins.getQuerySpaces
in interface LoadPlan
public LoadPlan.Disposition getDisposition()
LoadPlan
getDisposition
in interface LoadPlan
public boolean areLazyAttributesForceFetched()
LoadPlan
FETCH ALL PROPERTIES
key-phrase. In all other cases, this returns false.areLazyAttributesForceFetched
in interface LoadPlan
public boolean hasAnyScalarReturns()
LoadPlan
LoadPlan.getReturns()
for scalar root returns.hasAnyScalarReturns
in interface LoadPlan
true
if LoadPlan.getReturns()
contained any scalar returns; false
otherwise.Copyright © 2001-2015 Red Hat, Inc. All Rights Reserved.