class AdaptiveComponent extends QueryComponent
QueryComponent
to store additional
information needed when reverting an adaptive query from preselect to dynamic query mode.QueryComponent.ServerJoinData
Modifier and Type | Field and Description |
---|---|
private DMOSorter |
dmoSorter
DMO sorter associated with this component's sort clause
|
private java.lang.Object[] |
dynamicArgs
Substitution arguments for this component when in dynamic mode
|
private HQLPreprocessor |
dynamicHQLPreprocessor
HQL preprocessor used for dynamic mode
|
private CompoundComponent |
fallback
Compound query component fallback for multi-table, dynamic operation
|
private java.lang.Long |
globalEventID
Event registration ID used to gather index modification events
|
private DataModelObject |
inverse
DMO to which this component should join via a foreign relation.
|
private long |
lastGlobalEventID
ID of last index modification event retrieved from clearinghouse
|
private java.lang.String |
originalSort
HQL sort clause associated with this query component, original
|
private java.util.List<SortCriterion> |
sortCriteria
Sort criteria associated with this query component
|
CURRENT, FIRST, LAST, NEXT, NONE, PREVIOUS, RETRIEVE_MODES, UNIQUE
Constructor and Description |
---|
AdaptiveComponent(AdaptiveQuery query,
BufferReference proxy,
AbstractJoin join,
java.lang.String where,
java.lang.String sort,
java.lang.String indexInfo,
LockType lockType,
java.lang.Object[] args,
int iteration,
boolean outer,
BufferReference inverse)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
(package private) void |
cleanup()
Clean up when this component is no longer in use.
|
protected java.lang.Object[] |
getArgs()
Get substitution arguments for this component, resolving them first if necessary.
|
(package private) DMOSorter |
getDMOSorter()
Get the DMO sorter associated with this the index used to sort for this query component.
|
(package private) CompoundComponent |
getFallback()
Get the fallback compound component, which is used in the event an optimized, compound,
adaptive query if forced from preselect mode to dynamic mode.
|
protected HQLPreprocessor |
getHQLPreprocessor()
Get the HQL preprocessor associated with this component.
|
(package private) DataModelObject |
getInverse()
Get DMO (proxy) to which this component should join via a foreign relation.
|
protected java.lang.String |
getOriginalSort()
Get sort criteria in HQL order by clause format for this component.
|
(package private) java.util.List<SortCriterion> |
getSortCriteria()
Get the list of sort criteria associated with this query component.
|
(package private) void |
initialize()
Initialize instance variables which could not be set at construction, because they
required a scope to first be opened on the backing buffer.
|
protected HQLPreprocessor |
prepareHQLPreprocessor(java.lang.Object[] queryArgs)
Create the
HQLPreprocessor which backs this component. |
(package private) void |
processGlobalEvents()
Collect and process global events which describe changes made to DMO objects in other
sessions.
|
private void |
registerForGlobalEvents()
Register to receive global DMO change events, which may cause the current result set of
the containing query to be invalidated.
|
protected void |
resetHQLPreprocessor()
Reset both the preselect and dynamic HQL preprocessors, so that they need to be recreated
the next time one is requested.
|
(package private) void |
setFallback(CompoundComponent fallback)
Set the fallback compound component, which is used in the event an optimized, compound,
adaptive query if forced from preselect mode to dynamic mode.
|
compositeJoins, filterArgs, getBuffer, getEnclosingQuery, getIndexInfo, getIteration, getJoin, getLockType, getOriginalWhere, getRawArgs, getReferencedBuffers, getRestrictionProperties, getSortIndex, getWhere, isIdOnly, isOuter, prepareServerJoinData, resetArgs, resolveArgs, setIteration, setNotTop, setReferenceSubs, setRelatedBuffers, setSortIndex
private final java.lang.String originalSort
private final DataModelObject inverse
private java.util.List<SortCriterion> sortCriteria
private DMOSorter dmoSorter
private HQLPreprocessor dynamicHQLPreprocessor
private java.lang.Object[] dynamicArgs
private CompoundComponent fallback
private java.lang.Long globalEventID
private long lastGlobalEventID
AdaptiveComponent(AdaptiveQuery query, BufferReference proxy, AbstractJoin join, java.lang.String where, java.lang.String sort, java.lang.String indexInfo, LockType lockType, java.lang.Object[] args, int iteration, boolean outer, BufferReference inverse)
query
- Enclosing adaptive query.proxy
- Reference to record buffer updated by this component of the query.join
- Helper object for a join via a foreign key relation. May be null
.where
- Restriction criteria in HQL where clause format.sort
- Sort criteria in HQL order by clause format.indexInfo
- Index information string as it is returned by INDEX-INFORMATION. May be null
if it is not an OPEN QUERY case or if you don't need debug information about
selected indexes.lockType
- Requested record lock type.args
- Default (unresolved) query substitution arguments.iteration
- Type of iteration: FIRST, LAST, NEXT, PREVIOUS, or UNIQUE.outer
- true
if this component is joined with the previous component via an outer
join; false
if there is no previous component, or if this component is
joined with the previous component via an inner join.inverse
- DMO to which this query should join via a foreign relation. May be null
.protected HQLPreprocessor getHQLPreprocessor() throws PersistenceException
getHQLPreprocessor
in class QueryComponent
PersistenceException
- if the preprocessor must first be created, and there is an error during
its creation.protected HQLPreprocessor prepareHQLPreprocessor(java.lang.Object[] queryArgs) throws PersistenceException
HQLPreprocessor
which backs this component.
This method overrides the parent's implementation to also create a secondary HQL preprocessor for use in dynamic fetch mode. This secondary version does not inline any substitution parameters. If the primary version did not inline any such parameters, then both the primary and secondary preprocessors will be the same object.
prepareHQLPreprocessor
in class QueryComponent
queryArgs
- Query substitution parameters used in the preprocessor's creation.PersistenceException
- if there is an error creating the preprocessor.protected java.lang.Object[] getArgs() throws PersistenceException
getArgs
in class QueryComponent
PersistenceException
- if there is any error creating the HQL preprocessor, which
is necessary to properly filter/order the arguments.protected void resetHQLPreprocessor()
resetHQLPreprocessor
in class QueryComponent
void initialize() throws PersistenceException
PersistenceException
- if there is a database or parsing error.CompoundComponent getFallback()
void setFallback(CompoundComponent fallback)
fallback
- Compound query fallback component.void processGlobalEvents()
java.util.List<SortCriterion> getSortCriteria()
protected java.lang.String getOriginalSort()
SortCriterion
class.DataModelObject getInverse()
null
if no such join is defined for this query.DMOSorter getDMOSorter()
void cleanup()
private void registerForGlobalEvents()