private class AdaptiveFind.AdaptiveFindQuery extends AdaptiveQuery
P2JQuery.Parameter, P2JQuery.ParamResolver, P2JQuery.QueryEventListener, P2JQuery.QueryOpenedListenerSessionListener.Event, SessionListener.Scope| Modifier and Type | Field and Description |
|---|---|
private RecordBuffer |
buffer
Buffer updated by this query
|
private RecordBuffer[] |
externalBuffers
The resolved external buffers when the query was initialized.
|
private Record |
lastFound
Record most recently found by this query
|
cursor, errorCondition, foundFirstbetweenRows, components, currentRowDeleted, offEnd, sort, sortTranslated, unregisterOnCleanupclosed, dynamicPredicate, errorHelper, excluded, included, indexedReposition, inverseSorting, lenientOffEnd, outer, parameterFilterCURRENT, FIRST, ITERATE, LAST, NEXT, NONE, PREVIOUS, RETRIEVE_MODES, UNIQUE| Modifier | Constructor and Description |
|---|---|
private |
AdaptiveFindQuery() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponent(QueryComponent comp)
Add a component to the query.
|
protected boolean |
earlyInvalidate()
Check if this query should operate in dynamic mode right from the start.
|
boolean |
first(LockType lockType)
Retrieve the first composite row of results for the query.
|
private void |
init()
Initialize and flush the buffer.
|
void |
initialize(DataModelObject dmo,
java.lang.String where,
java.lang.String sort,
LockType lockType,
DataModelObject... dmos)
Convenience deferred initializer designed for a single-table adaptive query.
|
protected boolean |
isGlobalInvalidation()
Report whether this query must check for changes across all sessions and
possibly invalidate its current results if any are found.
|
boolean |
isLenientOffEnd()
If in silent error mode, this method will always return
true. |
protected boolean |
isTopLevelCleanup()
Indicate whether results resources should be cleaned up upon exiting the current program's top-level
scope or upon exiting the nearest enclosing scope in which the results were created.
|
private void |
maybeInvalidate()
Invalidate the current result set associated with this query if the record buffer's contents have
changed since the last time this query updated the buffer.
|
boolean |
next(LockType lockType)
Retrieve the next composite row of results for the query.
|
void |
releaseBuffers()
Release the current record, if any, from the buffer which is used by this query.
|
addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addDynamicSortCriterion, assembleOrderByClause, assembleWhereClause, backward, cleanup, clearDynamicSortCriteria, close, createCompoundQuery, createResultListEntry, createResults, createSimpleQuery, current, currentRow, currentRowImpl, deleteResultListEntry, execute, executeQuery, executeScroll, fetch, forceDynamicOperation, forward, getCachedRow, getCurrentIds, getCurrentIds, getRow, handleMissingJoinRecord, hintFullResults, initialize, initialize, initialize, initialize, invalidate, invalidateIfReferenceRowExists, isLocalInvalidation, isNativelyPreselect, isNativelyScrolling, isPreselect, last, load, loadByValues, open, peekNext, peekPrevious, prepareParameters, previous, reposition, repositionByID, repositionByID, reset, resetResults, resultsChanged, sessionEvent, setScrolling, setWorkerRefererenceRecord, shouldRegisterRecordChangeListeners, size, stateChanged, storeReferenceRow, toString, treatPreviousAsLast_isOffEnd, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addDynamicFilter, addExternalBuffers, addWhereExpression, anyBoundBufferInComponent, assembleFromAndWhereClauses, assembleOrderByClause, assembleOrderByClause, assembleSelectClause, backward, buildSortCriteria, cacheResults, clearDynamicFilters, clearRepoCache, close, components, coreFetch, current, deleted, deregisteredSessionListener, executeScroll, finished, first, forward, getArgs, getEntities, getExternalBuffers, getHQL, getJoin, getOffEnd, getOffEndListeners, getOriginalWhere, getPersistence, getRecordBuffers, getResults, getSortPhrase, getTableCount, getTemplateQueryRowid, getWhereExpressions, hasWhereExpression, indexInformation, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, isClientWhere, isFullRecords, isScrolling, iterate, last, makeAdaptiveServerJoinComponent, makePreselectServerJoinComponent, next, peekFirst, peekLast, prepareReposition, preserveBuffersOnEmptyResults, previous, processJoin, recordBuffers, registerCleaner, registerRecordChangeListeners, reposition, repositionByID, repositionByID, repositionByID, retry, setEmptyBuffersUnknown, setFullRecords, setIterationType, setIterationType, setLenientOffEnd, setNonScrolling, setResults, setUnknownRecord, shouldUpdateAnyLock, supportsArbitraryIteration, translateWhere, unique, unique, verifyJoins, whereExpressions_getNext, _isSkipDeletedRecord, accumulate, addAccumulator, addAccumulator, addBuffer, addBuffer, addQueryEventListener, addRepositionListener, afterReposition, afterReposition, afterReposition, bufferHandle, bufferHandle, bufferHandle, bufferHandle, bufferHandle, buffersMatch, changeForwardOnly, changeForwardOnly, deleteResultListEntry, exclude, forwardOnly, getCache, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getDataRelation, getDefaultLock, getErrorHelper, getExternalBuffersDefs, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getLast, getLast, getLast, getLast, getLast, getLast, getLast, getLast, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNumResults, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getReferencedBuffers, hasAccumulators, hasAny, hasAny, hasAny, hasAny, hasOne, hasOne, hasOne, hasOne, include, indexInformation, indexInformation, isBrowsed, isDynamicPredicate, isErrorIfNull, isFatalError, isFetchOnReposition, isFillingBrowseRows, isIndexedReposition, isIterating, isLastOfBreakGroup, isNewBreakGroup, isOffEnd, isOmitAlias, isOpen, isPresort, isRepositionNotificationActive, isSkipDeletedRecord, isStandalone, loadRowAtCursor, notifyQueryCloseListeners, notifyQueryOpenListeners, notifyRepositionListeners, numBuffers, numResults, numResults, prepare, prepare, prepareFetch, prepareString, preprocessSubstitutionArguments, queryBackward, queryBackward, queryClose, queryForward, queryForward, queryOpen, queryReposition, queryReposition, queryRepositionByID, removeRepositionListener, setBrowsed, setBuffers, setBuffers, setCache, setCache, setDataRelation, setDynamicPredicate, setErrorIfNull, setFatalError, setFetchOnReposition, setFillingBrowseRows, setIndexedReposition, setIterating, setOmitAlias, setOuter, setParameterFilter, setPresort, setSkipDeletedRecord, setStandalone, silentCurrent, silentCurrent, silentFirst, silentFirst, silentLast, silentLast, silentNext, silentNext, silentPrevious, silentPrevious, silentUnique, silentUnique, translateSort, translateSort, translateWhereclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclearResults, getReferencedBuffers, setErrorIfNull, setOuter_getNext, addAccumulator, addAccumulator, addQueryEventListener, addRepositionListener, changeForwardOnly, changeForwardOnly, deleteResultListEntry, exclude, forwardOnly, getBasicLogging, getCache, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getDataRelation, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getLast, getLast, getLast, getLast, getLast, getLast, getLast, getLast, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNumResults, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, hasAny, hasAny, hasAny, hasAny, hasOne, hasOne, hasOne, hasOne, include, indexInformation, indexInformation, isBrowsed, isDynamicPredicate, isFetchOnReposition, isFillingBrowseRows, isFindByRowid, isFirstOfGroup, isFirstOfGroup, isIndexedReposition, isIterating, isLastOfGroup, isLastOfGroup, isOffEnd, isPresort, isSkipDeletedRecord, isStandalone, notifyQueryCloseListeners, notifyQueryOpenListeners, notifyRepositionListeners, prepare, prepare, prepareString, queryBackward, queryBackward, queryClose, queryForward, queryForward, queryOpen, queryReposition, queryReposition, queryRepositionByID, queryRepositionByID, removeRepositionListener, resetQuery, setBasicLogging, setBasicLogging, setBrowsed, setCache, setCache, setDataRelation, setDynamicPredicate, setFetchOnReposition, setFillingBrowseRows, setIndexedReposition, setIterating, setParameterFilter, setPresort, setSkipDeletedRecord, setStandaloneaddBuffer, addBuffer, addBuffer, addBuffer, bufferHandle, bufferHandle, bufferHandle, bufferHandle, bufferHandle, numBuffers, setBuffers, setBuffers, setBuffersentry, initFailure, weightprivate RecordBuffer buffer
private Record lastFound
private RecordBuffer[] externalBuffers
public void initialize(DataModelObject dmo, java.lang.String where, java.lang.String sort, LockType lockType, DataModelObject... dmos)
dmo - DMO proxy which defines buffer and record type.where - FQL where clause. May be null.sort - FQL order by clause.lockType - Lock type to apply to records retrieved by this query.dmos - Zero or more external buffers.public boolean first(LockType lockType)
first in interface P2JQueryfirst in class AdaptiveQuerylockType - Lock type to apply to records retrieved (overrides default
lock type set for each query component).true if query could retrive the first record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.java.lang.IllegalStateException - if no query component has been added to this query.public boolean next(LockType lockType)
next in interface P2JQuerynext in class AdaptiveQuerylockType - Lock type to apply to records retrieved (overrides default
lock type set for each query component).true if query could retrive the next record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.java.lang.IllegalStateException - if no query component has been added to this query.public boolean isLenientOffEnd()
true.
Else, it will let the PreselectQuery.isLenientOffEnd() decide
the mode.isLenientOffEnd in class PreselectQuerytrue if an exception will be thrown, else
false.protected boolean isGlobalInvalidation()
isGlobalInvalidation in class AdaptiveQuerytrue if query is against a permanent table;
false if query is against a temporary table.protected void addComponent(QueryComponent comp)
addComponent in class PreselectQuerycomp - Query component to be added.java.lang.UnsupportedOperationException - if invoked more than once per instance; also:
if attempting an outer join (temporary);
if iteration type is not NEXT (temporary);public void releaseBuffers()
releaseBuffers in interface P2JQueryreleaseBuffers in class PreselectQueryQueryOffEndException - if the buffer contained a record and it was released.protected boolean isTopLevelCleanup()
isTopLevelCleanup in class PreselectQuerytrue.protected boolean earlyInvalidate()
earlyInvalidate in class AdaptiveQueryfalse as this isn't ever going to be invalidated early.private void init()
private void maybeInvalidate()