public final class PresortQuery extends PreselectQuery implements Presortable, PresortDelegate
Resolvable provided by business application code to sort the
result set returned by the database. This class supports the Progress
semantics of "client-side" results sorting and break groups. Multiple
levels of nested break groups are supported.
Sorting criteria is specified using the addSortCriterion
method. The order in which criteria are added is significant; the first
criterion added dictates the coarsest level of sorting. Each criterion
added subsequently only sorts rows within that criterion added immediately
previous to it.
P2JQuery.Parameter, P2JQuery.ParamResolver, P2JQuery.QueryEventListener, P2JQuery.QueryOpenedListenerSessionListener.Event, SessionListener.Scope| Modifier and Type | Field and Description |
|---|---|
private Presorter |
sorter
Helper which sorts preselected, unsorted results
|
betweenRows, components, currentRowDeleted, offEnd, sort, sortTranslated, unregisterOnCleanupclosed, dynamicPredicate, errorHelper, excluded, included, indexedReposition, inverseSorting, lenientOffEnd, outer, parameterFilterCURRENT, FIRST, ITERATE, LAST, NEXT, NONE, PREVIOUS, RETRIEVE_MODES, UNIQUE| Constructor and Description |
|---|
PresortQuery()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
addComponent(QueryComponent comp)
Add a component to the query.
|
void |
addDynamicSortCriterion(Resolvable sort,
boolean ascending)
Add a single dynamic sort criterion, in the form of a
Resolvable object which is
resolved at runtime. |
void |
addSortCriterion(Resolvable sort)
Add a single sort criterion, in the form of a
Resolvable
object which is resolved at sort time. |
void |
addSortCriterion(Resolvable sort,
boolean descending)
Add a single sort criterion, in the form of a
Resolvable
object which is resolved at runtime. |
protected java.util.ArrayList<SortCriterion> |
assembleOrderByClause()
Assemble the
order by clause for an HQL query. |
protected void |
assembleSelectClause(java.lang.StringBuilder buf)
Assemble the select clause for an HQL query.
|
void |
clearDynamicSortCriteria()
Clears all sort criteria added dynamically.
|
protected Results |
createResults(Results results)
Given the scrollable results set for the query, create an object which
implements the
Results interface. |
void |
enableBreakGroups()
Enable all sort criteria set for this query to act as break group
categories.
|
protected Results |
executeQuery(Persistence persistence,
java.lang.String fql,
java.lang.Object[] args)
Execute the query to create a first level result set.
|
protected <T> ScrollableResults<T> |
executeScroll(Persistence persistence,
java.lang.String hql,
java.lang.Object[] args)
Execute the query to create a
ScrollableResults result set. |
Results |
getSortedResults()
Access the current, sorted results for this query.
|
PresortQuery |
initialize()
Initialization logic which is typically used for a multi-table query.
|
PresortQuery |
initialize(boolean lenientOffEnd)
Initialization logic which is typically used for a multi-table query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
DataModelObject inverse)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
DataModelObject inverse,
LockType lockType)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
DataModelObject inverse,
java.lang.Object[] args)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
DataModelObject inverse,
java.lang.Object[] args,
LockType lockType)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
LockType lockType)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
java.lang.Object[] args)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
java.lang.Object[] args,
LockType lockType)
Initialization logic designed for a single-table preselect query.
|
PresortQuery |
initialize(DataModelObject dmo,
java.lang.String where,
java.util.function.Supplier<logical> whereExpr,
java.lang.String sort,
java.lang.String indexInfo,
DataModelObject inverse,
java.lang.Object[] args,
LockType lockType)
Initialization logic designed for a single-table preselect query.
|
logical |
isFirst()
Determine whether the query result row currently being visited is the
first row in the presorted results list.
|
logical |
isFirstOfGroup(int level)
Determine whether the query result row currently being visited is the first row of the
query's result set or the first row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isFirstOfGroup(integer level)
Determine whether the query result row currently being visited is the first row of the
query's result set or the first row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isFirstOfGroup(Resolvable key)
Determine whether the query result row currently being visited is the
first row within a break group whose category is identified by the
specified resolvable object.
|
logical |
isLast()
Determine whether the query result row currently being visited is the
last row in the presorted results list.
|
protected boolean |
isLastOfBreakGroup(Resolvable key)
Determine whether the query result row currently being visited is the
last row within a break group whose category is identified by the
specified resolvable object.
|
logical |
isLastOfGroup(int level)
Determine whether the query result row currently being visited is the last row of the
query's result set or the last row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isLastOfGroup(integer level)
Determine whether the query result row currently being visited is the last row of the
query's result set or the last row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isLastOfGroup(Resolvable key)
Determine whether the query result row currently being visited is the
last row within a break group whose category is identified by the
specified resolvable object.
|
protected boolean |
isNativelyScrolling()
Indicate whether this query type is scrolling by its nature.
|
protected boolean |
isNewBreakGroup(Resolvable key)
Determine whether the query result row currently being visited is the
first row within a break group whose category is identified by the
specified resolvable object.
|
boolean |
isPresort()
Indicate whether the query is of presort type.
|
protected boolean |
preserveBuffersOnEmptyResults(Results results)
Indicate whether the record buffer(s) current record(s) should be preserved, in the event
the query does not find any results.
|
boolean |
shouldRegisterRecordChangeListeners()
Check if this type of query should register record change listeners.
|
protected boolean |
supportsArbitraryIteration()
Does this query support non-NEXT iteration components?
|
_isOffEnd, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addComponent, addDynamicFilter, addDynamicSortCriterion, addExternalBuffers, addWhereExpression, anyBoundBufferInComponent, assembleFromAndWhereClauses, assembleOrderByClause, assembleOrderByClause, assembleWhereClause, backward, backward, buildSortCriteria, cacheResults, cleanup, clearDynamicFilters, clearRepoCache, close, close, components, coreFetch, createResultListEntry, current, current, currentRow, currentRowImpl, deleted, deleteResultListEntry, deregisteredSessionListener, execute, fetch, finished, first, first, forceDynamicOperation, forward, forward, getArgs, getEntities, getExternalBuffers, getHQL, getJoin, getOffEnd, getOffEndListeners, getOriginalWhere, getPersistence, getRecordBuffers, getResults, getRow, getSortPhrase, getTableCount, getTemplateQueryRowid, getWhereExpressions, handleMissingJoinRecord, hasWhereExpression, indexInformation, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, initialize, isClientWhere, isFullRecords, isLenientOffEnd, isNativelyPreselect, isPreselect, isScrolling, isTopLevelCleanup, iterate, last, last, load, makeAdaptiveServerJoinComponent, makePreselectServerJoinComponent, next, next, open, peekFirst, peekLast, peekNext, peekPrevious, prepareParameters, prepareReposition, previous, previous, processJoin, recordBuffers, registerCleaner, registerRecordChangeListeners, releaseBuffers, reposition, reposition, repositionByID, repositionByID, repositionByID, repositionByID, reset, resetResults, retry, sessionEvent, setEmptyBuffersUnknown, setFullRecords, setIterationType, setIterationType, setLenientOffEnd, setNonScrolling, setResults, setScrolling, setUnknownRecord, shouldUpdateAnyLock, size, stateChanged, toString, translateWhere, treatPreviousAsLast, 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, isOffEnd, isOmitAlias, isOpen, 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, waitgetRecordBuffersclearResults, 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, hintFullResults, include, indexInformation, indexInformation, isBrowsed, isDynamicPredicate, isFetchOnReposition, isFillingBrowseRows, isFindByRowid, isIndexedReposition, isIterating, isOffEnd, 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 Presorter sorter
public PresortQuery()
initialize() is
called.public PresortQuery initialize()
addComponent method variants.
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
public PresortQuery initialize(boolean lenientOffEnd)
addComponent method variants.
This variant is used by code which is converted from an OPEN QUERY
statement, which permits advancing off the end of a result set without
raising a QueryOffEndException.
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
lenientOffEnd - true if advancing past either end of the result
set should NOT raise a QueryOffEndException;
false if doing so should raise the exception.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, DataModelObject inverse)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.inverse - DMO to which this query should join via a foreign relation.
May be null.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, java.lang.Object[] args)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.args - Substitution parameters to be inserted into placeholders within
the where clause.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, DataModelObject inverse, java.lang.Object[] args)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.inverse - DMO to which this query should join via a foreign relation.
May be null.args - Substitution parameters to be inserted into placeholders within
the where clause.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, LockType lockType)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.lockType - Lock type to apply to records retrieved by this query.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, DataModelObject inverse, LockType lockType)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.inverse - DMO to which this query should join via a foreign relation.
May be null.lockType - Lock type to apply to records retrieved by this query.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, java.lang.Object[] args, LockType lockType)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.args - Substitution parameters to be inserted into placeholders within
the where clause.lockType - Lock type to apply to records retrieved by this query.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, DataModelObject inverse, java.lang.Object[] args, LockType lockType)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
dmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.inverse - DMO to which this query should join via a foreign relation.
May be null.args - Substitution parameters to be inserted into placeholders within
the where clause.lockType - Lock type to apply to records retrieved by this query.public PresortQuery initialize(DataModelObject dmo, java.lang.String where, java.util.function.Supplier<logical> whereExpr, java.lang.String sort, java.lang.String indexInfo, DataModelObject inverse, java.lang.Object[] args, LockType lockType)
This code is intentionally separated from the constructor. The purpose of this separation is to allow construction to occur in the prior scope while initialization can still occur within a method or lambda that is inside the next block's scope.
initialize in class PreselectQuerydmo - DMO proxy which defines buffer and record type.where - HQL where clause. May be null.whereExpr - Client-side where clause expression. May be null.sort - Sort clause that corresponds the index which defines the sort
order for this query. May be null.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.inverse - DMO to which this query should join via a foreign relation.
May be null.args - Substitution parameters to be inserted into placeholders within
the where clause.lockType - Lock type to apply to records retrieved by this query. If null, the default lock level
is assumed.public void addSortCriterion(Resolvable sort)
Resolvable
object which is resolved at sort time. It is the value of the resolved
result which is used for the sort.
The sort is ascending, from lowest resolved value to highest.
addSortCriterion in interface PresortDelegatesort - A resolvable object whose resolved result is used for sorting.public void addSortCriterion(Resolvable sort, boolean descending)
Resolvable
object which is resolved at runtime. It is the value of the resolved
result which is used for the sort.addSortCriterion in interface PresortDelegatedescending - if true, the sort is descending, from highest
resolved value to lowest; otherwise, the sort is ascending.sort - A resolvable object whose resolved result is used for sorting.public void addDynamicSortCriterion(Resolvable sort, boolean ascending)
Resolvable object which is
resolved at runtime. It is the value of the resolved result which is used for the sort.
Unlike addSortCriterion(com.goldencode.p2j.util.Resolvable) methods, the criterion is added with higher priority.
addDynamicSortCriterion in interface PresortDelegatesort - A resolvable object whose resolved result is used for sorting.ascending - if true, the sort is ascending, from lowest resolved value to highest;
otherwise, the sort is descending.public void clearDynamicSortCriteria()
clearDynamicSortCriteria in interface PresortDelegateclearDynamicSortCriteria in class PreselectQuerypublic void enableBreakGroups()
enableBreakGroups in interface PresortDelegatepublic boolean shouldRegisterRecordChangeListeners()
shouldRegisterRecordChangeListeners in interface JoinableshouldRegisterRecordChangeListeners in class PreselectQuerytrue if we should invest time into computing the scope in order
to call PreselectQuery.registerRecordChangeListeners(java.lang.Integer) or false if we
can skip doing any work to honor PreselectQuery.registerRecordChangeListeners(java.lang.Integer).public logical isFirst()
isFirst in interface PresortDelegatetrue if the current result row is the first row,
else false.public boolean isPresort()
isPresort in interface P2JQueryisPresort in class AbstractQueryiterating - true indicating that a query of presort type.true if the query is of presort type..public logical isFirstOfGroup(Resolvable key)
isFirstOfGroup in interface PresortDelegatekey - Break group category key. Must be the same object reference
as was specified previously when invoking one of the
addSortCriterion method variants.true if break groups are enabled and current row
is first in the specified break group;
false if break groups have not been enabled or
current row is not first in the specified break group.public logical isFirstOfGroup(integer level)
isFirstOfGroup in interface P2JQueryisFirstOfGroup in interface PresortDelegatelevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.true if the current row is first in the result set or within the specified
break group; else false.public logical isFirstOfGroup(int level)
isFirstOfGroup in interface P2JQuerylevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.true if the current row is first in the result set or within the specified
break group; else false.public logical isLast()
isLast in interface PresortDelegatetrue if the current result row is the last row,
else false.public logical isLastOfGroup(Resolvable key)
isLastOfGroup in interface PresortDelegatekey - Break group category key. Must be the same object reference
as was specified previously when invoking one of the
addSortCriterion method variants.true if break groups are enabled and current row
is last in the specified break group;
false if break groups have not been enabled or
current row is not last in the specified break group.public logical isLastOfGroup(integer level)
isLastOfGroup in interface P2JQueryisLastOfGroup in interface PresortDelegatelevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.
Must not be unknown value.true if the current row is last in the result set or within the specified
break group; else false.public logical isLastOfGroup(int level)
isLastOfGroup in interface P2JQuerylevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.true if the current row is last in the result set or within the specified
break group; else false.public Results getSortedResults()
getSortedResults in interface PresortableResults object used to retrieve sorted results.protected void addComponent(QueryComponent comp)
addComponent in class PreselectQuerycomp - Query component to be added.java.lang.UnsupportedOperationException - if attempting an outer join (temporary);
if iteration type is not NEXT (temporary);
if the component's DMO's associated database is different than
that of a previously added component's database (cross-database
preselect joins are not possible).protected boolean supportsArbitraryIteration()
supportsArbitraryIteration in class PreselectQuerytrueprotected boolean preserveBuffersOnEmptyResults(Results results)
This implementation returns true only if break groups are enabled. Also, this checks if the results are truly empty. For a presort query, the results are always "full".
preserveBuffersOnEmptyResults in class PreselectQueryresults - The results instance to decide if they are truly empty. The results are not visible
in some sub-classes, so let them be passed by parameter.true if break groups are enabled, else false.protected boolean isLastOfBreakGroup(Resolvable key)
isLastOfBreakGroup in class AbstractQuerykey - Break group category key. Must be the same object reference
as was specified previously when invoking one of the
addSortCriterion method variants.true if break groups are enabled and current row
is last in the specified break group;
false if break groups have not been enabled or
current row is not last in the specified break group.protected boolean isNewBreakGroup(Resolvable key)
This is the backing worker method for isFirstOfGroup(com.goldencode.p2j.util.Resolvable) and is
used internally by the query to manage accumulators.
isNewBreakGroup in class AbstractQuerykey - Break group category key. Must be the same object reference
as was specified previously when invoking one of the
addSortCriterion method variants.true if current row is first in a break group;
false if it is not; unknown value if break groups
have not been enabled.protected Results executeQuery(Persistence persistence, java.lang.String fql, java.lang.Object[] args) throws PersistenceException
This default implementation returns an object which is a thin wrapper around
ScrollableResults. This overrides the parent method as it needs a
specific Results implementation: ForwardResults.
In case when the fql represents a valid template record query (a test on recid /
rowid of the record against the unique _file._template for current record of the
single QueryComponent), a special Results object is returned with a single
element that is the template record for the buffer of the component.
executeQuery in class PreselectQuerypersistence - Object which is used to execute the query.fql - FQL query string.args - Substitution parameters to be inserted into placeholders within the FQL query string.ForwardResults which wrappers the
ScrollableResults object returned by the execution of the query.PersistenceException - if there is an error executing the query.protected <T> ScrollableResults<T> executeScroll(Persistence persistence, java.lang.String hql, java.lang.Object[] args) throws PersistenceException
ScrollableResults result set.
Override the parent's implementation to use a ScrollMode of FORWARD_ONLY,
which may permit the use of a server-side cursor by the JDBC driver.
executeScroll in class PreselectQuerypersistence - Object which is used to execute the query.hql - HQL query string.args - Substitution parameters to be inserted into placeholders within the HQL query
string.ScrollableResults object returned by the execution of the query.PersistenceException - if there is an error executing the query.protected Results createResults(Results results) throws PersistenceException
Results interface. It is this object which
will actually be used to retrieve the primary key values of records to
be loaded from the database.
This implementation returns a specialized Results object,
which sorts the results obtained from the caller, according to one or
more sort criterion provided by client code.
createResults in class PreselectQueryresults - An object used to access the records which meet this query's criteria.Results object which presorts the results.PersistenceException - if there is any error creating resultsprotected boolean isNativelyScrolling()
Subclasses which are not natively scrolling should override this method.
isNativelyScrolling in class PreselectQueryfalse.protected void assembleSelectClause(java.lang.StringBuilder buf)
select {buffer0} [, {buffer1} [...]]
This method overrides the parent's implementation to make it a full query, rather than projection query which returns only the record's primary key. This is necessary to presort the results without issuing a separate select to the database to retrieve each record during the presort process.
assembleSelectClause in class PreselectQuerybuf - String buffer into which clause is assembled.protected java.util.ArrayList<SortCriterion> assembleOrderByClause() throws PersistenceException
order by clause for an HQL query.assembleOrderByClause in class PreselectQuerySortCriterion objects which describe the sort behavior for this query.PersistenceException - never.