public final class QueryWrapper extends HandleChain implements P2JQuery, ADMData, UniqueID, DynamicResource, ResultListHandler
AbstractQuery
s. An
instance of this class contains an instance of AbstractQuery
,
to which it delegates the work of all of its methods.
The purpose of this class is to support queries defined in Progress using
the DEFINE QUERY statement. These may be defined once, but opened and
closed multiple times. In the P2J implementation, a new instance of
AbstractQuery
is constructed each time a query is "opened"
(i.e., an OPEN QUERY was issued in the pre-conversion code). Since a
reference to the query may be held by many routines, the query's internal
state must be updated when the query is opened or re-opened. This is
accomplished by sharing a reference to an instance of this class, which
always holds the most recently constructed, underlying query. Thus, since
all routines are accessing the query via this container (i.e., essentially
by proxy), they will always be accessing the correct, underlying query.
When a new query is opened, the new AbstractQuery
instance is
stored in the wrapper via one of the assign
method variants.
The public methods of this class may only be invoked if the underlying
delegate query is of a type which implements a method of the same
signature. Many methods are supported by AbstractQuery
, which is
the abstract base class of all concrete query implementations. However,
certain methods are implemented only by particular implementations. These
will fail with an IllegalStateException
if invoked when the
wrong type of delegate has been set.
When an instance of this class is first created, a no-op, default
implementation of P2JQuery
is assigned immediately. This
ensures that at least those methods which are defined by the
P2JQuery
interface have a safe methods. However, this does
not protect the caller from invoking methods which are unique to specific
query types, if no safe delegate has first been assigned. This safety
measure is intended to protect other runtime code which generically uses
an instance of this class via the P2JQuery
interface (such as
BrowseWidge
in the UI).
A query wrapped by this object may need to clean up resources when the
wrapper goes out of scope. A cleaner object is registered with the
transaction manager upon construction of the wrapper, at the next external
scope. This scope assumes that a QueryWrapper
is only
instantiated as an instance member of a business logic class. This is the
case for all converted Progress code.
Modifier and Type | Class and Description |
---|---|
private static class |
QueryWrapper.DefaultDelegate
A no-op implementation of
P2JQuery which is used as the
default delegate for the enclosing QueryWrapper . |
P2JQuery.Parameter
Modifier and Type | Field and Description |
---|---|
private character |
admData
Corresponds ADM-DATA attribute.
|
private boolean |
advanced
Flag indicating if the query has been advanced (via GET NEXT) to the next record.
|
private boolean |
browsed
Is query associated with a UI browse widget?
|
private java.util.List<Buffer> |
buffers
The set of buffers used by this dynamic query.
|
private boolean |
cleanerRegistered
If the cleaner is already registered as a finalizable for this wrapper.
|
private boolean |
closed
Flag indicating if the query was explicitly closed or is not open.
|
private boolean |
closing
Flag indicating if the query is closing.
|
private static P2JQuery |
DEFAULT_DELEGATE
Default delegate to use before a real one is assigned
|
private P2JQuery |
delegate
Delegate query
|
private boolean |
dynamic
Flag indicating if this query is dynamic.
|
private boolean |
errorIfNull
Should delegate's failed first/last/unique retrievals raise error?
|
private boolean |
fetchOnReposition
Should the next row of the delegate be fetched after a reposition?
|
private boolean |
forwardOnly
Corresponds FORWARD-ONLY attribute.
|
private java.lang.String |
prepareString
Contains the prepare string set by
prepare(java.lang.String) . |
private java.lang.String |
qname
Internal reference for the query's name.
|
private WeakList<RepositionListener> |
repoListeners
Reposition listeners registered with the delegate query
|
private boolean |
scrolling
Should delegate be a scrolling query?
|
private boolean |
skipDeletedRecord
Internal value of SKIP-DELETED-RECORD.
|
private integer |
uniqueID
Corresponds UNIQUE-ID attribute.
|
private boolean |
valid
Check if this query is valid.
|
name, nextSibling, prevSibling
instProc
Modifier | Constructor and Description |
---|---|
|
QueryWrapper(java.lang.String name,
boolean scrolling)
Constructor which creates a static query and sets query scrolling mode for all delegate
queries assigned to this wrapper.
|
private |
QueryWrapper(java.lang.String name,
boolean scrolling,
boolean dynamic)
Constructor which sets query scrolling mode for all delegate queries assigned to this
wrapper.
|
Modifier and Type | Method and Description |
---|---|
boolean |
_dynamic()
Conversion of DYNAMIC attribute.
|
boolean |
_isOffEnd()
Indicate whether the cursor has run off one or the other end of the
associated query's list of available results.
|
void |
addAccumulator(Accumulator accum)
Add an accumulator to this query.
|
void |
addAccumulator(Accumulator accum,
boolean deferred)
Add an accumulator to this query.
|
logical |
addBuffer(Buffer buf)
Adds one new buffer to a query object or dynamic ProDataSet object,
without affecting the other buffers, if any.
|
logical |
addBuffer(Buffer buf,
boolean staticCall)
Adds one new buffer to a query object or dynamic ProDataSet object,
without affecting the other buffers, if any.
|
logical |
addBuffer(handle bufHandle)
Adds one new buffer to a query object or dynamic ProDataSet object,
without affecting the other buffers, if any.
|
private void |
addBuffers(Joinable query,
boolean clear)
Add the buffers associated with the given query to this QUERY's buffer list.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
DataModelObject inverse)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
DataModelObject inverse,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
DataModelObject inverse,
java.lang.Object[] args)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
DataModelObject inverse,
java.lang.Object[] args,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
DataModelObject inverse,
java.lang.Object[] args,
LockType lockType,
int iteration,
boolean outer)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.Object[] args)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.Object[] args,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.Object[] args,
LockType lockType,
int iteration,
boolean outer)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
DataModelObject inverse)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
DataModelObject inverse,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
DataModelObject inverse,
java.lang.Object[] args)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
DataModelObject inverse,
java.lang.Object[] args,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
DataModelObject inverse,
java.lang.Object[] args,
LockType lockType,
int iteration,
boolean outer)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
java.lang.Object[] args)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
java.lang.Object[] args,
LockType lockType)
Add a component to a preselect query.
|
void |
addComponent(DataModelObject dmo,
java.lang.String where,
java.lang.String indexInfo,
java.lang.Object[] args,
LockType lockType,
int iteration,
boolean outer)
Add a component to a preselect query.
|
void |
addComponent(Joinable query)
Add a joinable query to a compound query.
|
void |
addComponent(Joinable query,
int iteration)
Add a joinable query to a compound query, and specify the nature of
the iteration which will be performed (first, last, next, etc.) on that
component, when the compound query is iterated.
|
void |
addComponent(Joinable query,
int iteration,
boolean outer)
Add a joinable query to a compound query, and specify the nature of
the iteration which will be performed (first, last, next, etc.) on that
component, when the compound query is iterated.
|
void |
addRepositionListener(RepositionListener listener)
Register a listener to receive notifications reposition events for this
query.
|
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. |
void |
addWhereExpression(java.util.function.Supplier<logical> whereExpr)
Add a client-side where expression to a preselect query.
|
void |
assign(CompoundQuery delegate)
Assign a newly opened
CompoundQuery instance as this
container's active delegate query. |
void |
assign(PreselectQuery delegate)
Assign a newly opened
PreselectQuery instance as this
container's active delegate query. |
void |
assign(RandomAccessQuery delegate)
Assign a newly opened
RandomAccessQuery instance as this
container's active delegate query. |
private void |
assignImpl(P2JQuery delegate)
Assign a
P2JQuery instance as this container's active
delegate query. |
private void |
assignImpl(P2JQuery delegate,
boolean open)
Assign a
P2JQuery instance as this container's active
delegate query. |
boolean |
backward(int rows)
Move the current cursor position backward by the specified number of
rows.
|
boolean |
backward(NumberType rows)
Move the current cursor position backward by the specified number of
rows.
|
handle |
bufferHandle()
Conversion of GET-BUFFER-HANDLE() method (KW_GET_BUFH).
|
handle |
bufferHandle(character bufferName)
Conversion of GET-BUFFER-HANDLE() method (KW_GET_BUFH).
|
handle |
bufferHandle(int bufferSequenceNumber)
Conversion of GET-BUFFER-HANDLE() method (KW_GET_BUFH).
|
handle |
bufferHandle(integer bufferSequenceNumber)
Conversion of GET-BUFFER-HANDLE() method (KW_GET_BUFH).
|
handle |
bufferHandle(java.lang.String bufferName)
Conversion of GET-BUFFER-HANDLE() method (KW_GET_BUFH).
|
private boolean |
canAddBuffer()
Check if a buffer can be added to this query.
|
private boolean |
canGet()
Check if the query is opened.
|
private boolean |
canGetFirst()
Check if the query can be advanced via GET-FIRST.
|
private boolean |
canGetStmt()
Check if the query is opened.
|
private boolean |
canLastOrPrev()
Check if the GET-LAST or GET-FIRST can be executed.
|
void |
changeForwardOnly(boolean forwardOnly)
Conversion of FORWARD-ONLY attribute (KW_FWD_ONLY).
|
void |
changeForwardOnly(logical forwardOnly)
Conversion of FORWARD-ONLY attribute (KW_FWD_ONLY).
|
void |
cleanup()
Delegate cleanup processing to the query wrapped by this object.
|
void |
close()
Explicitly close the prepared query delegate.
|
private CompoundQuery |
compoundDelegate()
Convenience method to access the delegate query as an instance of
CompoundQuery . |
static void |
createQuery(handle hQuery)
Dynamically creates a query and assign it to a handle.
|
static void |
createQuery(handle hQuery,
character widgetPool)
Dynamically creates a query in the specified widget pool and assign
it to a handle.
|
static void |
createQuery(handle hQuery,
java.lang.String widgetPool)
Dynamically creates a query in the specified widget pool and assign
it to a handle.
|
logical |
createResultListEntry()
This will creates an entry in the result list for the current row.
|
void |
current()
Reload the record most recently loaded into the backing record buffer,
if any.
|
void |
current(LockType lockType)
Reload the record most recently loaded into the backing record buffer,
if any.
|
integer |
currentRow()
Progress-compatible function that returns the 1-based index of the
current row in the result set.
|
integer |
currentRowImpl()
Get the 1-based index of the current row in the result set.
|
logical |
deleteResultListEntry()
Deletes the current row of a query's result list.
|
logical |
deleteResultListEntry(boolean allowBetweenRows)
Deletes the current row of a query's result list.
|
logical |
dynamic()
Conversion of DYNAMIC attribute.
|
void |
enableBreakGroups()
Enable all sort criteria set for this query to act as break group
categories.
|
void |
exclude(DataModelObject dmo,
java.lang.String... fields)
Specifies the fields excluded from a record retrieval.
|
void |
first()
Navigate to the first record which meets the query criteria and retrieve
it into its record buffer.
|
void |
first(boolean iterating)
Retrieve the first virtual, composite row of results for a compound
query.
|
void |
first(boolean iterating,
LockType lockType)
Retrieve the first virtual, composite row of results for a compound
query, overriding the lock type to apply to each underlying query.
|
void |
first(LockType lockType)
Navigate to the first record which meets the query criteria and retrieve
it into its record buffer.
|
void |
first(java.lang.Object[] values)
Navigate to the first record which meets the query criteria and retrieve
it into its record buffer.
|
void |
first(java.lang.Object[] values,
LockType lockType)
Navigate to the first record which meets the query criteria and retrieve
it into its record buffer.
|
boolean |
forward(int rows)
Advance the current cursor position forward by the specified number of
rows.
|
boolean |
forward(NumberType rows)
Advance the current cursor position forward by the specified number of
rows.
|
logical |
forwardOnly()
Conversion of FORWARD-ONLY attribute (KW_FWD_ONLY).
|
character |
getADMData()
Get the value of the ADM-DATA attribute.
|
logical |
getCurrent()
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(LockType lockType)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(long lock)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(long lock,
long nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(long lock,
NumberType nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(NumberType lock)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(NumberType lock,
long nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(NumberType lock,
NumberType nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
private P2JQuery |
getDelegate()
Convenience method to access the current delegate query.
|
logical |
getFirst()
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getFirst(LockType lockType)
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getFirst(long lock)
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getFirst(long lock,
long nowait)
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getFirst(long lock,
NumberType nowait)
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getFirst(NumberType lock)
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getFirst(NumberType lock,
long nowait)
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getFirst(NumberType lock,
NumberType nowait)
Conversion of GET-FIRST method (KW_GET_1ST).
|
logical |
getLast()
Conversion of GET-LAST method (KW_GET_LAST).
|
logical |
getLast(LockType lockType)
Conversion of GET-LAST method (KW_GET_LAST).
|
logical |
getLast(long lock)
Conversion of GET-LAST method (KW_GET_LAST).
|
logical |
getLast(long lock,
long nowait)
Conversion of GET-LAST method (KW_GET_LAST).
|
logical |
getLast(long lock,
NumberType nowait)
Conversion of GET-LAST method (KW_GET_LAST).
|
logical |
getLast(NumberType lock)
Conversion of GET-LAST method (KW_GET_LAST).
|
logical |
getLast(NumberType lock,
long nowait)
Conversion of GET-LAST method (KW_GET_LAST).
|
logical |
getLast(NumberType lock,
NumberType nowait)
Conversion of GET-LAST method (KW_GET_LAST).
|
java.lang.String |
getName()
Get legacy query name.
|
logical |
getNext()
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(LockType lockType)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(long lock)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(long lock,
long nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(long lock,
NumberType nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(NumberType lock)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(NumberType lock,
long nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(NumberType lock,
NumberType nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
integer |
getNumResults()
Conversion of NUM-RESULTS attribute (KW_NUM_RES).
|
OffEnd |
getOffEnd()
Get the off-end status of the query, which indicates whether the query
has run off either end of its results.
|
java.util.List<QueryOffEndListener> |
getOffEndListeners()
Get all the off-end listeners associated with this query.
|
logical |
getPrevious()
Conversion of GET-PREV method (KW_GET_PREV).
|
logical |
getPrevious(LockType lockType)
Conversion of GET-PREV method (KW_GET_PREV).
|
logical |
getPrevious(long lock)
Conversion of GET-PREV method (KW_GET_PREV).
|
logical |
getPrevious(long lock,
long nowait)
Conversion of GET-PREV method (KW_GET_PREV).
|
logical |
getPrevious(long lock,
NumberType nowait)
Conversion of GET-PREV method (KW_GET_PREV).
|
logical |
getPrevious(NumberType lock)
Conversion of GET-PREV method (KW_GET_PREV).
|
logical |
getPrevious(NumberType lock,
long nowait)
Conversion of GET-PREV method (KW_GET_PREV).
|
logical |
getPrevious(NumberType lock,
NumberType nowait)
Conversion of GET-PREV method (KW_GET_PREV).
|
int |
getTableCount()
Get the number of tables joined by this query.
|
integer |
getUniqueID()
Gets the the unique ID number associated to this object by the underlying system.
|
logical |
hasAny()
Indicate whether a request to find the first result of this query would
succeed or fail.
|
logical |
hasAny(LockType lockType)
Indicate whether a request to find the first result of this query would
succeed or fail.
|
logical |
hasAny(java.lang.Object[] values)
Indicate whether a request to find the first result of this query would
succeed or fail.
|
logical |
hasAny(java.lang.Object[] values,
LockType lockType)
Indicate whether a request to find the first result of this query would
succeed or fail.
|
logical |
hasOne()
Indicate whether this query would produce a unique result.
|
logical |
hasOne(LockType lockType)
Indicate whether this query would produce a unique result.
|
logical |
hasOne(java.lang.Object[] values)
Indicate whether this query would produce a unique result.
|
logical |
hasOne(java.lang.Object[] values,
LockType lockType)
Indicate whether this query would produce a unique result.
|
void |
include(DataModelObject dmo,
java.lang.String... fields)
Specifies the fields included in a record retrieval.
|
character |
indexInformation()
Conversion of INDEX-INFORMATION attribute (KW_IDX_INFO).
|
character |
indexInformation(int n)
Conversion of INDEX-INFORMATION attribute (KW_IDX_INFO).
|
character |
indexInformation(NumberType n)
Conversion of INDEX-INFORMATION attribute (KW_IDX_INFO).
|
boolean |
isBrowsed()
Is this query associated with a browse widget or not?
|
boolean |
isFetchOnReposition()
Is this query set to fetch the next record after a reposition?
|
logical |
isFirst()
Determine whether the query result row currently being visited is the
first row in the presorted results list.
|
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.
|
logical |
isLastOfGroup(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 |
isNativelyPreselect()
Indicate whether this query is a preselect query by its nature.
|
logical |
isOffEnd()
Indicate whether the cursor has run off one or the other end of the
associated query's list of available results.
|
logical |
isOpen()
Conversion of IS-OPEN attribute (KW_IS_OPEN).
|
boolean |
isPreselect()
Indicate whether this query preselects all of its results.
|
boolean |
isScrolling()
Indicate whether this query was defined as SCROLLING.
|
logical |
isSkipDeletedRecord()
Get value of SKIP-DELETED-RECORD attribute of the query.
|
boolean |
isStandalone()
Indicate whether this query stands alone, or is the component of
another query, or is wrapped by a query wrapper.
|
void |
iterate()
Advance a compound query, triggering one or more of the underlying
queries to retrieve a new record.
|
void |
last()
Navigate to the last record which meets the query criteria and retrieve
it into its record buffer.
|
void |
last(boolean iterating)
Retrieve the last virtual, composite row of results for a compound
query.
|
void |
last(boolean iterating,
LockType lockType)
Retrieve the last virtual, composite row of results for a compound
query, overriding the lock type to apply to each underlying query.
|
void |
last(LockType lockType)
Navigate to the last record which meets the query criteria and retrieve
it into its record buffer.
|
void |
last(java.lang.Object[] values)
Navigate to the last record which meets the query criteria and retrieve
it into its record buffer.
|
void |
last(java.lang.Object[] values,
LockType lockType)
Navigate to the last record which meets the query criteria and retrieve
it into its record buffer.
|
void |
next()
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
void |
next(boolean iterating)
Retrieve the next virtual, composite row of results for a compound
query.
|
void |
next(boolean iterating,
LockType lockType)
Retrieve the next virtual, composite row of results for a compound
query, overriding the lock type to apply to each underlying query.
|
void |
next(LockType lockType)
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
void |
next(java.lang.Object[] values)
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
void |
next(java.lang.Object[] values,
LockType lockType)
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
void |
notifyListeners()
Deprecated.
Use #open() instead.
|
void |
notifyRepositionListeners(boolean closed,
boolean error,
int targetRepositionRow)
Notify all registered listeners that query is repositioned or closed.
|
integer |
numBuffers()
Conversion of NUM-BUFFERS() method (KW_NUM_BUFF).
|
void |
open()
Open the prepared query delegate.
|
void |
optimize()
Optimize this query, the details of which are up to the delegate query's implementation.
|
logical |
prepare(character predicate)
Compiles a predicate (query condition).
|
logical |
prepare(java.lang.String predicate)
Compiles a predicate (query condition).
|
character |
prepareString()
Conversion of PREPARE_STRING attribute (KW_PREP_STR).
|
private PreselectQuery |
preselectDelegate()
Convenience method to access the delegate query as an instance of
PreselectQuery . |
private PresortDelegate |
presortDelegate()
Convenience method to access the delegate query as an instance of
PresortDelegate . |
void |
previous()
Navigate to the previous record which meets the query criteria and
retrieve it into its record buffer.
|
void |
previous(boolean iterating)
Retrieve the previous virtual, composite row of results for a compound
query.
|
void |
previous(boolean iterating,
LockType lockType)
Retrieve the previous virtual, composite row of results for a compound
query, overriding the lock type to apply to each underlying query.
|
void |
previous(LockType lockType)
Navigate to the previous record which meets the query criteria and
retrieve it into its record buffer.
|
void |
previous(java.lang.Object[] values)
Navigate to the previous record which meets the query criteria and
retrieve it into its record buffer.
|
void |
previous(java.lang.Object[] values,
LockType lockType)
Navigate to the previous record which meets the query criteria and
retrieve it into its record buffer.
|
logical |
queryBackward(int rows)
Conversion of REPOSITION-BACKWARD() method (KW_REPOS_B).
|
logical |
queryBackward(NumberType rows)
Conversion of REPOSITION-BACKWARD() method (KW_REPOS_B).
|
logical |
queryClose()
Conversion of QUERY-CLOSE() method (KW_QRY_CLOS).
|
logical |
queryForward(int rows)
Conversion of REPOSITION-FORWARD() method (KW_REPOS_F).
|
logical |
queryForward(NumberType rows)
Conversion of REPOSITION-FORWARD() method (KW_REPOS_F).
|
logical |
queryOpen()
Opens a query object.
|
logical |
queryReposition(int n)
Conversion of REPOSITION-TO-ROW() method (KW_REPOS_2R).
|
logical |
queryReposition(NumberType n)
Conversion of REPOSITION-TO-ROW() method (KW_REPOS_2R).
|
logical |
queryRepositionByID(rowid id1,
rowid... joinIDs)
Conversion of REPOSITION-TO-ROWID() method (KW_REPOS_2I).
|
private RandomAccessQuery |
randomAccessDelegate()
Convenience method to access the delegate query as an instance of
RandomAccessQuery . |
private void |
registerBufferRelatedQueries()
Register this wrapper as a related query for all participating buffers.
|
private void |
registerCleaner()
Register the cleaner which closes the query when the external [persistent] procedure in
which the query was opened is deleted.
|
void |
removeRepositionListener(RepositionListener listener)
Unregister a listener that was receiving notifications on reposition events for this
query.
|
void |
reposition(int row)
Reposition the query to the specified row in the result set.
|
void |
reposition(NumberType row)
Reposition the cursor to the specified row in the result set.
|
void |
repositionByID(recid id)
Reposition the cursor such that a request to retrieve the next result
will retrieve the result which matches the specified primary key ID.
|
void |
repositionByID(rowid id1,
rowid... joinIDs)
Reposition the cursor such that a request to retrieve the next result
will retrieve the result which matches the specified array of primary
key IDs.
|
protected boolean |
resourceDelete()
Delete the resource.
|
void |
setADMData(character value)
Set the value of the ADM-DATA attribute.
|
void |
setADMData(java.lang.String value)
Set the value of the ADM-DATA attribute.
|
void |
setBrowsed(boolean browsed)
Indicate to this query that whether it is associated with a browse
widget or not.
|
logical |
setBuffers(Buffer... bufs)
Sets buffers for the query.
|
logical |
setBuffers(handle... hBuffers)
Sets buffers for the query.
|
void |
setErrorIfNull(boolean errorIfNull)
Set a mode on the underlying buffers such that setting a null record
into a buffer may or may not result in an error condition.
|
P2JQuery |
setExternalBuffers(DataModelObject... dmos)
Set one or more buffers which this query references externally.
|
void |
setFetchOnReposition(boolean enable)
Set this query to automatically fetch the next record after a
reposition, or turn this feature off.
|
void |
setIterationType(int iteration)
Set the iteration type for the most recently added query component to a preselect query.
|
void |
setIterationType(int iteration,
java.lang.String sort)
Set the iteration type for the most recently added query component to a preselect query.
|
void |
setParameterFilter(ParameterFilter parameterFilter)
Set the filter that handles parameters passed to the query.
|
void |
setScrolling()
Ensure that any
AbstractQuery assigned to this wrapper is
a scrolling query, to enable results list scrolling/repositioning. |
void |
setSkipDeletedRecord(logical on)
Setter for SKIP-DELETED-RECORD query attribute.
|
void |
setStandalone(boolean standalone)
Change the standalone nature of this query.
|
integer |
size()
Get the current size of the cached results list.
|
void |
unique()
Navigate to a particular record which meets the query criteria and
retrieve it into its record buffer.
|
void |
unique(LockType lockType)
Navigate to a particular record which meets the query criteria and
retrieve it into its record buffer.
|
void |
unique(java.lang.Object[] values)
Navigate to a particular record which meets the query criteria and
retrieve it into its record buffer.
|
void |
unique(java.lang.Object[] values,
LockType lockType)
Navigate to a particular record which meets the query criteria and
retrieve it into its record buffer.
|
private void |
unregisterBufferRelatedQueries()
Unregister this wrapper from the list of related queries for all participating buffers.
|
boolean |
valid()
Reports if this query (that is, its delegate query) is valid for use.
|
private boolean |
validBuffer(handle h,
int idx)
Check if the resource referenced by given handle is a valid
Buffer . |
delete, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameReadOnly, hasNextSibling, hasParent, hasPrevSibling, hasPrivateData, interlink, isChained, lastResource, lastResource, name, name, name, readOnlyError, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData
getResourceType, id, id, implicitDeletion, instantiatingProcedure, invalidAttribute, setInstantiatingProcedure, type, unknown
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getResourceType
id, id, unknown
private static final P2JQuery DEFAULT_DELEGATE
private P2JQuery delegate
private WeakList<RepositionListener> repoListeners
private boolean scrolling
private boolean errorIfNull
private boolean fetchOnReposition
private boolean browsed
private boolean closing
private boolean closed
private boolean advanced
private boolean dynamic
private final character admData
private final integer uniqueID
private boolean forwardOnly
private java.lang.String prepareString
prepare(java.lang.String)
.private java.util.List<Buffer> buffers
private boolean valid
private final java.lang.String qname
private boolean cleanerRegistered
private boolean skipDeletedRecord
public QueryWrapper(java.lang.String name, boolean scrolling)
name
- The legacy name of this query.scrolling
- true
to set all delegate queries assigned to this wrapper to scrolling
mode, else false
to not use scrolling mode.private QueryWrapper(java.lang.String name, boolean scrolling, boolean dynamic)
name
- The legacy name of this query.scrolling
- true
to set all delegate queries assigned to this wrapper to scrolling
mode, else false
to not use scrolling mode.dynamic
- Flag identifying a dynamic query.private void registerCleaner()
public static void createQuery(handle hQuery, java.lang.String widgetPool)
CREATE QUERY
from 4GL.hQuery
- The handle to assign the newly created query.widgetPool
- The name of the widget pool that contains the dynamic query. null
if
the unnamed pool must be used.public static void createQuery(handle hQuery, character widgetPool)
CREATE QUERY
from 4GL.hQuery
- The handle to assign the newly created query.widgetPool
- The name of the widget pool that contains the dynamic query. null
if
the unnamed pool must be used.public static void createQuery(handle hQuery)
CREATE QUERY
from 4GL.hQuery
- The handle to assign the newly created query.public logical dynamic()
true
if the buffer is dynamic.dynamic
in interface DynamicResource
true
if the resource is dynamic, false
otherwise.public boolean _dynamic()
true
if the buffer is dynamic._dynamic
in interface DynamicResource
true
if the resource is dynamic, false
otherwise.public void assign(CompoundQuery delegate)
CompoundQuery
instance as this
container's active delegate query.delegate
- New delegate query.public void assign(PreselectQuery delegate)
PreselectQuery
instance as this
container's active delegate query.delegate
- New delegate query.public void assign(RandomAccessQuery delegate)
RandomAccessQuery
instance as this
container's active delegate query.delegate
- New delegate query.public void setScrolling()
AbstractQuery
assigned to this wrapper is
a scrolling query, to enable results list scrolling/repositioning. If
a query is already assigned to this wrapper, invoke its
setScrolling
method immediately.setScrolling
in interface P2JQuery
public boolean isScrolling()
isScrolling
in interface P2JQuery
true
if this query is scrolling.public void close()
public void optimize()
public int getTableCount()
getTableCount
in interface P2JQuery
public java.util.List<QueryOffEndListener> getOffEndListeners()
getOffEndListeners
in interface P2JQuery
public P2JQuery setExternalBuffers(DataModelObject... dmos)
setExternalBuffers
in interface P2JQuery
dmos
- One or more external buffers.public void setErrorIfNull(boolean errorIfNull)
FIRST
, LAST
, and UNIQUE
iteration types.
If a query delegate has already been set, it is updated with the new setting immediately. The setting is remembered, such that any delegate assigned after this method is invoked will have this setting updated upon assignment to the query wrapper.
setErrorIfNull
in interface P2JQuery
errorIfNull
- If true
, setting a null
value as the
current record in an underlying buffer will raise an error
condition (if not in silent error mode); if false
,
this action will raise an end condition instead.public void addComponent(Joinable query)
NEXT
iteration type.query
- Query which will perform the fundamental work for this
component when the compound query is iterated.java.lang.IllegalStateException
- if this method is invoked during an iteration cycle or if
delegate is not an instance of CompoundQuery
.iterate()
public void addComponent(Joinable query, int iteration)
query
- Query which will perform the fundamental work for this
component when the compound query is iterated.iteration
- A constant
indicating the type of work
to be performed upon an iteration of the compound query. This
parameter determines whether the underlying query will be asked
to perform a first, last, next, previous, or unique record
retrieval.java.lang.IllegalStateException
- if this method is invoked during an iteration cycle or if
delegate is not an instance of CompoundQuery
.iterate()
public void addComponent(Joinable query, int iteration, boolean outer)
outer
.query
- Query which will perform the fundamental work for this
component when the compound query is iterated.iteration
- A constant
indicating the type of work
to be performed upon an iteration of the compound query. This
parameter determines whether the underlying query will be asked
to perform a first, last, next, previous, or unique record
retrieval.outer
- true
if this component should be joined to the
previously added component via a left outer join;
false
if an inner join is required. Note that
adding an inner join component will cause any previously added
components added as outer joins to be reset to inner joins.java.lang.IllegalStateException
- if this method is invoked during an iteration cycle or if
delegate is not an instance of CompoundQuery
.iterate()
public void addComponent(DataModelObject dmo, java.lang.String where)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. May be null
.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, DataModelObject inverse)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. May be null
.inverse
- DMO to which this query should join via a foreign relation.
May be null
.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, DataModelObject inverse)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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
.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.Object[] args)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. May be null
.args
- Substitution parameters to be inserted into placeholders within
the where clause.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, java.lang.Object[] args)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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.args
- Substitution parameters to be inserted into placeholders within
the where clause.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, DataModelObject inverse, java.lang.Object[] args)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, DataModelObject inverse, java.lang.Object[] args)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. May be null
.lockType
- Lock type to apply to records retrieved by this component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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.lockType
- Lock type to apply to records retrieved by this component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, DataModelObject inverse, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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 component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, DataModelObject inverse, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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
.lockType
- Lock type to apply to records retrieved by this component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.Object[] args, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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 component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, java.lang.Object[] args, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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.args
- Substitution parameters to be inserted into placeholders within
the where clause.lockType
- Lock type to apply to records retrieved by this component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, DataModelObject inverse, java.lang.Object[] args, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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 component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, DataModelObject inverse, java.lang.Object[] args, LockType lockType)
NEXT
iteration type
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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 component of
the query.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.Object[] args, LockType lockType, int iteration, boolean outer)
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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 component of
the query.iteration
- Iteration/retrieval mode for this component of the query. At
this time, only NEXT
is supported. Future
support for FIRST
, LAST
, and
UNIQUE
is expected.outer
- true
if an outer join is required. At this time,
only inner joins are supported. Future support for outer
joins is expected.java.lang.UnsupportedOperationException
- if outer
is true
(temporary);
if iteration
is not NEXT
(temporary);
if dmo
's associated database is different than
that of a previously added component's database (cross-database
preselect joins are not possible).java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, java.lang.Object[] args, LockType lockType, int iteration, boolean outer)
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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.args
- Substitution parameters to be inserted into placeholders within
the where clause.lockType
- Lock type to apply to records retrieved by this component of
the query.iteration
- Iteration/retrieval mode for this component of the query. At
this time, only NEXT
is supported. Future
support for FIRST
, LAST
, and
UNIQUE
is expected.outer
- true
if an outer join is required. At this time,
only inner joins are supported. Future support for outer
joins is expected.java.lang.UnsupportedOperationException
- if outer
is true
(temporary);
if iteration
is not NEXT
(temporary);
if dmo
's associated database is different than
that of a previously added component's database (cross-database
preselect joins are not possible).java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, DataModelObject inverse, java.lang.Object[] args, LockType lockType, int iteration, boolean outer)
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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 component of
the query.iteration
- Iteration/retrieval mode for this component of the query. At
this time, only NEXT
is supported. Future
support for FIRST
, LAST
, and
UNIQUE
is expected.outer
- true
if an outer join is required. At this time,
only inner joins are supported. Future support for outer
joins is expected.java.lang.UnsupportedOperationException
- if outer
is true
(temporary);
if iteration
is not NEXT
(temporary);
if dmo
's associated database is different than
that of a previously added component's database (cross-database
preselect joins are not possible).java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addComponent(DataModelObject dmo, java.lang.String where, java.lang.String indexInfo, DataModelObject inverse, java.lang.Object[] args, LockType lockType, int iteration, boolean outer)
dmo
- DMO proxy which defines buffer and record type.where
- HQL where clause. 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 component of
the query.iteration
- Iteration/retrieval mode for this component of the query. At
this time, only NEXT
is supported. Future
support for FIRST
, LAST
, and
UNIQUE
is expected.outer
- true
if an outer join is required. At this time,
only inner joins are supported. Future support for outer
joins is expected.java.lang.UnsupportedOperationException
- if outer
is true
(temporary);
if iteration
is not NEXT
(temporary);
if dmo
's associated database is different than
that of a previously added component's database (cross-database
preselect joins are not possible).java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void addWhereExpression(java.util.function.Supplier<logical> whereExpr)
whereExpr
- Client-side where clause expression. May not be
null
.java.lang.NullPointerException
- if whereExpr
is null
.java.lang.IllegalStateException
- if delegate is not an instance of PreselectQuery
.public void setIterationType(int iteration)
iteration
- Retrieval mode from QueryConstants
. Must not be FIRST or LAST (use
setIterationType(int, String)
instead for these types.java.lang.IllegalStateException
- if no component has yet been added; or
if delegate is not an instance of PreselectQuery
.java.lang.IllegalArgumentException
- if iteration
type is FIRST
or LAST
.public void setIterationType(int iteration, java.lang.String sort)
iteration
- Retrieval mode from QueryConstants
.sort
- Order by clause which should be associated with the most recently added query
component. Must be non-null
for iteration types FIRST
and LAST
.java.lang.IllegalStateException
- if no component has yet been added; or
if delegate is not an instance of PreselectQuery
.java.lang.IllegalArgumentException
- if iteration
type is FIRST
or LAST
, but
sort
is null
, or if sort
represents an
invalid HQL order by expression.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.
The delegate must be an instance of PresortDelegate
sort
- A resolvable object whose resolved result is used for sorting.java.lang.IllegalStateException
- if delegate is not an instance of PresortDelegate
.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.
The delegate must be an instance of PresortDelegate
sort
- A resolvable object whose resolved result is used for sorting.descending
- if true
, the sort is descending, from highest
resolved value to lowest; otherwise, the sort is ascending.java.lang.IllegalStateException
- if delegate is not an instance of PresortDelegate
.public void enableBreakGroups()
The delegate must be an instance of PresortDelegate
java.lang.IllegalStateException
- if delegate is not an instance of PresortDelegate
.public void addAccumulator(Accumulator accum)
This implementation assumes the accumulator is not associated with a break group.
addAccumulator
in interface P2JQuery
accum
- Accumulator to be registered with this query.public void addAccumulator(Accumulator accum, boolean deferred)
This implementation assumes the accumulator is not associated with a break group.
addAccumulator
in interface P2JQuery
accum
- Accumulator to be registered with this query.deferred
- If true
, calls to iterate()
will not
cause the accumulator to recalculate immediately, but instead
to update the accumulator's state such that the next invocation
of Accumulator.accumulate()
will
trigger the actual accumulation update. If false
,
the accumulator recalculates its internal state immediatelypublic boolean valid()
valid
in interface WrappedResource
true
if this query's delegate is valid for use.public void iterate()
QueryOffEndException
- if no more records can be retrieved by the underlying queries.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void first()
first
in interface P2JQuery
ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.public void first(LockType lockType)
first
in interface P2JQuery
lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.public void first(boolean iterating)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void first(boolean iterating, LockType lockType)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.lockType
- Lock type which should override that of any underlying query.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void first(java.lang.Object[] values)
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void first(java.lang.Object[] values, LockType lockType)
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void last()
last
in interface P2JQuery
ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.public void last(LockType lockType)
last
in interface P2JQuery
lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.public void last(boolean iterating)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void last(boolean iterating, LockType lockType)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.lockType
- Lock type which should override that of any underlying query.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void last(java.lang.Object[] values)
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void last(java.lang.Object[] values, LockType lockType)
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.QueryOffEndException
- if no record could be found when operating in compound query
mode.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void next()
Use the record most recently loaded into the backing buffer as the reference point when determining the next record to visit. If no record has yet been loaded into the buffer, retrieve the first record which meets the query criteria.
next
in interface P2JQuery
ErrorConditionException
- if an error occurred during record retrieval.public void next(LockType lockType)
Use the record most recently loaded into the backing buffer as the reference point when determining the next record to visit. If no record has yet been loaded into the buffer, retrieve the first record which meets the query criteria.
next
in interface P2JQuery
lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval.public void next(boolean iterating)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void next(boolean iterating, LockType lockType)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.lockType
- Lock type which should override that of any underlying query.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void next(java.lang.Object[] values)
Use the record most recently loaded into the backing buffer as the reference point when determining the next record to visit. If no record has yet been loaded into the buffer, retrieve the first record which meets the query criteria.
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.ErrorConditionException
- if an error occurred during record retrieval.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void next(java.lang.Object[] values, LockType lockType)
Use the record most recently loaded into the backing buffer as the reference point when determining the next record to visit. If no record has yet been loaded into the buffer, retrieve the first record which meets the query criteria.
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void previous()
Use the record most recently loaded into the backing buffer as the reference point when determining the previous record to visit. If no record has yet been loaded into the buffer, retrieve the last record which meets the query criteria.
previous
in interface P2JQuery
ErrorConditionException
- if an error occurred during record retrieval.public void previous(LockType lockType)
Use the record most recently loaded into the backing buffer as the reference point when determining the previous record to visit. If no record has yet been loaded into the buffer, retrieve the last record which meets the query criteria.
previous
in interface P2JQuery
lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval.public void previous(boolean iterating)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void previous(boolean iterating, LockType lockType)
This is a combination of records retrieved by each component query. If the compound query involves outer joins, some of the underlying buffers may be empty when this method returns.
iterating
- true
if this method is being invoked within the
context of an iterating loop, which can only be exited by
raising an end condition; false
if end condition
should not be raised, even if no further advancement of the
composite result is possible.lockType
- Lock type which should override that of any underlying query.QueryOffEndException
- if no more results were available in iterating mode.ErrorConditionException
- if an underlying query triggers an error.java.lang.IllegalStateException
- if delegate is not an instance of CompoundQuery
.public void previous(java.lang.Object[] values)
Use the record most recently loaded into the backing buffer as the reference point when determining the previous record to visit. If no record has yet been loaded into the buffer, retrieve the last record which meets the query criteria.
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.ErrorConditionException
- if an error occurred during record retrieval.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void previous(java.lang.Object[] values, LockType lockType)
Use the record most recently loaded into the backing buffer as the reference point when determining the previous record to visit. If no record has yet been loaded into the buffer, retrieve the last record which meets the query criteria.
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void current()
current
in interface P2JQuery
ErrorConditionException
- if an error occurred during record reload.public void current(LockType lockType)
current
in interface P2JQuery
lockType
- New lock type to apply to the record.ErrorConditionException
- if an error occurred during record reload, or the lock could
not be transitioned to the requested type.public void unique()
unique
in interface P2JQuery
ErrorConditionException
- if an error occurred during record retrieval or if more than
one record is found which match the criteria.QueryOffEndException
- if no record could be found when operating in compound query
mode.public void unique(LockType lockType)
unique
in interface P2JQuery
lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval or if more than
one record is found which match the criteria.QueryOffEndException
- if no record could be found when operating in compound query
mode.public void unique(java.lang.Object[] values)
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.ErrorConditionException
- if an error occurred during record retrieval or if more than
one record is found which match the criteria.QueryOffEndException
- if no record could be found when operating in compound query
mode.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public void unique(java.lang.Object[] values, LockType lockType)
The delegate must be an instance of RandomAccessQuery
values
- Substitution values to use when issuing HQL queries.lockType
- Lock type to acquire for the retrieved record.ErrorConditionException
- if an error occurred during record retrieval or if more than
one record is found which match the criteria.QueryOffEndException
- if no record could be found when operating in compound query
mode.java.lang.IllegalStateException
- if delegate is not an instance of
RandomAccessQuery
.public logical hasAny()
Default substitution arguments and a lock type of NONE
are
used for this test.
public logical hasAny(java.lang.Object[] values)
The specified substitution arguments and a lock type of
NONE
are used for this test.
public logical hasAny(LockType lockType)
Default substitution arguments and the specified lock type are used for this test.
public logical hasAny(java.lang.Object[] values, LockType lockType)
The specified substitution arguments and lock type are used for this test.
hasAny
in interface P2JQuery
values
- Query substitution parameters.lockType
- Lock type for the query. This lock is not actually acquired,
only tested for availability.true
if the first record exists, else false
.java.lang.UnsupportedOperationException
- always.public logical hasOne()
Default substitution arguments and a lock type of NONE
are
used for this test.
public logical hasOne(java.lang.Object[] values)
The specified substitution arguments and a lock type of
NONE
are used for this test.
public logical hasOne(LockType lockType)
Default substitution arguments and the specified lock type are used for this test.
public logical hasOne(java.lang.Object[] values, LockType lockType)
The specified substitution arguments and lock type are used for this test.
hasOne
in interface P2JQuery
values
- Query substitution parameters.lockType
- Lock type for the query. This lock is not actually acquired,
only tested for availability.true
if any record matching the query's criteria
exists, else false
.java.lang.UnsupportedOperationException
- always.public boolean isFetchOnReposition()
isFetchOnReposition
in interface P2JQuery
true
if set to fetch after reposition, else
false
.public void setFetchOnReposition(boolean enable)
setFetchOnReposition
in interface P2JQuery
enable
- true
to enable automatic fetching;
false
to disable.public void addRepositionListener(RepositionListener listener)
addRepositionListener
in interface P2JQuery
listener
- Reposition listener to be registered.public void removeRepositionListener(RepositionListener listener)
removeRepositionListener
in interface P2JQuery
listener
- Reposition listener to be unregistered.public void setBrowsed(boolean browsed)
setBrowsed
in interface P2JQuery
browsed
- true
to indicate the query has an associated
browse widget, else false
.public boolean isBrowsed()
public void repositionByID(recid id)
repositionByID
in interface P2JQuery
id
- A primary key ID, representing the target record (in the case
of a join, this ID is associated with the left-most record in
the join).ErrorConditionException
- if the specified ID represents the unknown value.public void repositionByID(rowid id1, rowid... joinIDs)
repositionByID
in interface P2JQuery
id1
- A primary key ID, representing the target record (in the case
of a join, this ID is associated with the left-most record in
the join).joinIDs
- All remaining primary key IDs, if any, arranged from left to
right to coincide with the records being joined by the
underlying query.ErrorConditionException
- if this query is not a scrolling query;
if any of the specified IDs represents the unknown value.public void reposition(NumberType row)
reposition
in interface P2JQuery
row
- 1-based index of the target position.ErrorConditionException
- if this query is not a scrolling query;
if row
represents unknown value.public void reposition(int row)
reposition
in interface P2JQuery
row
- 1-based index of the target position.ErrorConditionException
- if this query is not a scrolling query.public boolean forward(NumberType rows)
forward
in interface P2JQuery
rows
- Number of rows to scroll the cursor forward.true
if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false
is returned then it is
possible that cursor's position was moved but not with rows
rows.ErrorConditionException
- if this query is not a scrolling query;
if rows
represents the unknown value.public boolean forward(int rows)
forward
in interface P2JQuery
rows
- Number of rows to scroll the cursor forward.true
if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false
is returned then it is
possible that cursor's position was moved but not with rows
rows.ErrorConditionException
- if this query is not a scrolling query.public boolean backward(NumberType rows)
backward
in interface P2JQuery
rows
- Number of rows to scroll the cursor backward.true
if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false
is returned then it is
possible that cursor's position was moved but not with rows
rows.ErrorConditionException
- if this query is not a scrolling query;
if rows
represents the unknown value.public boolean backward(int rows)
backward
in interface P2JQuery
rows
- Number of rows to scroll the cursor backward.true
if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false
is returned then it is
possible that cursor's position was moved but not with rows
rows.ErrorConditionException
- if this query is not a scrolling query.public integer size()
size
in interface P2JQuery
ErrorConditionException
- if this query is not a scrolling query.public integer currentRow()
currentRow
in interface P2JQuery
public integer currentRowImpl()
currentRowImpl
in interface P2JQuery
ErrorConditionException
- if this query is not a scrolling query.public logical isOffEnd()
true
,
this indicates that the query cannot produce any more results in the
current scroll direction.isOffEnd
in interface P2JQuery
true
if the cursor is off either end of its
query's results list.ErrorConditionException
- if this query is not a scrolling query.public boolean _isOffEnd()
true
,
this indicates that the query cannot produce any more results in the
current scroll direction._isOffEnd
in interface P2JQuery
true
if the cursor is off either end of its
query's results list.ErrorConditionException
- if this query is not a scrolling query.public OffEnd getOffEnd()
public logical isFirst()
The delegate must be an instance of PresortDelegate
true
if the current result row is the first row,
else false
.java.lang.IllegalStateException
- if delegate is not an instance of PresortDelegate
.public logical isFirstOfGroup(Resolvable key)
The delegate must be an instance of PresortDelegate
key
- 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.java.lang.IllegalStateException
- if delegate is not an instance of PresortDelegate
.public logical isLast()
The delegate must be an instance of PresortDelegate
true
if the current result row is the last row,
else false
.java.lang.IllegalStateException
- if delegate is not an instance of PresortDelegate
.public logical isLastOfGroup(Resolvable key)
The delegate must be an instance of PresortDelegate
key
- 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.java.lang.IllegalStateException
- if delegate is not an instance of PresortDelegate
.public boolean isPreselect()
isPreselect
in interface P2JQuery
true
if the query preselects its results;
false
if the query's results are dynamically
navigated.public boolean isNativelyPreselect()
isNativelyPreselect
in interface P2JQuery
true
.public void notifyRepositionListeners(boolean closed, boolean error, int targetRepositionRow)
notifyRepositionListeners
in interface P2JQuery
closed
- A true
value will inform all listeners that the
query was explicitly closed.error
- true
if an error happened during reposition.targetRepositionRow
- Row used as the target for reposition. If it was deleted, reposition with fetching
may end up on a different row.public void notifyListeners()
public boolean isStandalone()
isStandalone
in interface P2JQuery
true
; query wrappers may not themselves be
wrapped.public void setStandalone(boolean standalone)
Instances of QueryWrapper
may not be wrapped in other
queries or query wrappers, so this implementation throws an exception
if this method is invoked with a parameter of true
.
setStandalone
in interface P2JQuery
standalone
- true
to set query as standalone;
false
to set query as contained.java.lang.UnsupportedOperationException
- if standalone
is set to true
.public void cleanup()
cleanup
in interface P2JQuery
P2JQuery.cleanup()
public handle bufferHandle()
bufferHandle
in interface P2JQuery
public handle bufferHandle(java.lang.String bufferName)
bufferHandle
in interface P2JQuery
bufferName
- buffer-name. A CHARACTER expression that evaluates to the name
of a buffer in the query or ProDataSet object.public handle bufferHandle(character bufferName)
bufferHandle
in interface P2JQuery
bufferName
- buffer-name. A CHARACTER expression that evaluates to the name
of a buffer in the query or ProDataSet object.public handle bufferHandle(int bufferSequenceNumber)
bufferHandle
in interface P2JQuery
bufferSequenceNumber
- buffer-sequence-number. An INTEGER that represents the sequence
number of the desired buffer.public handle bufferHandle(integer bufferSequenceNumber)
bufferHandle
in interface P2JQuery
bufferSequenceNumber
- buffer-sequence-number. An INTEGER that represents the sequence
number of the desired buffer.public logical queryClose()
queryClose
in interface P2JQuery
true
if QUERY-CLOSE() succeeds,
else false
.public logical queryBackward(int rows)
queryBackward
in interface P2JQuery
true
if REPOSITION-BACKWARD() succeeds,
else false
.public logical queryBackward(NumberType rows)
queryBackward
in interface P2JQuery
true
if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false
is returned then it is
possible that cursor's position was moved but not with rows
rows.public logical queryForward(int rows)
queryForward
in interface P2JQuery
true
if REPOSITION-FORWARD() succeeds,
else false
.public logical queryForward(NumberType rows)
queryForward
in interface P2JQuery
true
if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false
is returned then it is
possible that cursor's position was moved but not with rows
rows.public logical queryReposition(int n)
queryReposition
in interface P2JQuery
n
- An integer expression representing the sequence number.true
if REPOSITION-TO-ROW() succeeds,
else false
.public logical queryReposition(NumberType n)
queryReposition
in interface P2JQuery
n
- An integer expression representing the sequence number.true
if REPOSITION-TO-ROW() succeeds,
else false
.public logical queryRepositionByID(rowid id1, rowid... joinIDs)
queryRepositionByID
in interface P2JQuery
id1
- A primary key ID, representing the target record (in the case
of a join, this ID is associated with the left-most record in
the join).joinIDs
- All remaining primary key IDs, if any, arranged from left to
right to coincide with the records being joined by the
underlying query.true
if REPOSITION-TO-ROWID() succeeds,
else false
.public integer getNumResults()
getNumResults
in interface P2JQuery
public logical addBuffer(handle bufHandle)
public logical addBuffer(Buffer buf)
public logical addBuffer(Buffer buf, boolean staticCall)
buf
- A buffer to add.staticCall
- true
if it is internal call for a static query.public logical setBuffers(handle... hBuffers)
addBuffer()
method to add one
buffer to the object, without affecting the other buffers, if any.
This method is the equivalent of SET-BUFFERS()
method
from 4GL.setBuffers
in interface P2JQuery
hBuffers
- Variable argument list of buffer handles to be set.
In 4GL, the maximum number of buffers per query is 18.public logical setBuffers(Buffer... bufs)
addBuffer()
method to add one
buffer to the object, without affecting the other buffers, if any.
This method is the equivalent of SET-BUFFERS()
method
from 4GL.setBuffers
in interface P2JQuery
bufs
- Variable argument list of Buffer to be set.
In 4GL, the maximum number of buffers per query is 18.public logical prepare(java.lang.String predicate)
QUERY-PREPARE()
method from 4GL.public logical prepare(character predicate)
QUERY-PREPARE()
method from 4GL.public logical queryOpen()
QUERY-OPEN()
method from 4GL.
Note: You must perform prepare()
on a query
object before you perform queryOpen
on it.public character indexInformation()
indexInformation
in interface IndexInformation
indexInformation
in interface P2JQuery
public character indexInformation(int n)
indexInformation
in interface IndexInformation
indexInformation
in interface P2JQuery
n
- An integer expression that evaluates to the level of join for which you want
index information.public character indexInformation(NumberType n)
indexInformation
in interface IndexInformation
indexInformation
in interface P2JQuery
n
- An integer expression that evaluates to the level of join for which you want index
information.public logical forwardOnly()
forwardOnly
in interface P2JQuery
public void changeForwardOnly(logical forwardOnly)
changeForwardOnly
in interface P2JQuery
forwardOnly
- New value of FORWARD-ONLY attribute.public void changeForwardOnly(boolean forwardOnly)
changeForwardOnly
in interface P2JQuery
forwardOnly
- New value of FORWARD-ONLY attribute.public character prepareString()
prepareString
in interface P2JQuery
public logical isOpen()
public character getADMData()
getADMData
in interface ADMData
public void setADMData(java.lang.String value)
setADMData
in interface ADMData
value
- The new value.public void setADMData(character value)
setADMData
in interface ADMData
value
- The new value.public integer getUniqueID()
getUniqueID
in interface UniqueID
protected boolean resourceDelete()
resourceDelete
in class HandleChain
true
if the resource was deleted.public logical getNext()
getNext
in interface P2JQuery
true
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).public logical getNext(LockType lockType)
getNext
in interface P2JQuery
lockType
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).public logical getNext(long lock)
getNext
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getNext(NumberType lock)
getNext
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getNext(long lock, long nowait)
getNext
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getNext(long lock, NumberType nowait)
getNext
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getNext(NumberType lock, long nowait)
getNext
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getNext(NumberType lock, NumberType nowait)
getNext
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false
. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getPrevious()
getPrevious
in interface P2JQuery
true
if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).public logical getPrevious(long lock)
getPrevious
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getPrevious(LockType lockType)
getPrevious
in interface P2JQuery
lockType
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getPrevious(NumberType lock)
getPrevious
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if thgetPe previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getPrevious(long lock, long nowait)
getPrevious
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getPrevious(NumberType lock, long nowait)
getPrevious
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getPrevious(long lock, NumberType nowait)
getPrevious
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getPrevious(NumberType lock, NumberType nowait)
getPrevious
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false
.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getFirst()
public logical getFirst(long lock)
getFirst
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getFirst(NumberType lock)
getFirst
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getFirst(LockType lockType)
getFirst
in interface P2JQuery
lockType
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getFirst(long lock, long nowait)
getFirst
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getFirst(NumberType lock, long nowait)
getFirst
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getFirst(long lock, NumberType nowait)
getFirst
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getFirst(NumberType lock, NumberType nowait)
getFirst
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getLast()
public logical getLast(long lock)
getLast
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getLast(NumberType lock)
getLast
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getLast(LockType lockType)
getLast
in interface P2JQuery
lockType
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
has not valid internal value.public logical getLast(long lock, long nowait)
getLast
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getLast(NumberType lock, long nowait)
getLast
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getLast(long lock, NumberType nowait)
getLast
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getLast(NumberType lock, NumberType nowait)
getLast
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false
. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException
- if lock
or nowait
have not valid internal values.public logical getCurrent()
getCurrent
in interface P2JQuery
true
if GET-CURRENT() succeeds, else false
.public logical getCurrent(long lock)
getCurrent
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if GET-CURRENT() succeeds, else false
.public logical getCurrent(NumberType lock)
getCurrent
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue
if GET-CURRENT() succeeds, else false
.public logical getCurrent(LockType lockType)
getCurrent
in interface P2JQuery
lockType
- of LockTypetrue
if GET-CURRENT() succeeds, else false
.public logical getCurrent(long lock, long nowait)
getCurrent
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if GET-CURRENT() succeeds, else false
.public logical getCurrent(NumberType lock, long nowait)
getCurrent
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if GET-CURRENT() succeeds, else false
.public logical getCurrent(long lock, NumberType nowait)
getCurrent
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if GET-CURRENT() succeeds, else false
.public logical getCurrent(NumberType lock, NumberType nowait)
getCurrent
in interface P2JQuery
lock
- SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait
- NO-WAITtrue
if GET-CURRENT() succeeds, else false
.public logical createResultListEntry()
createResultListEntry
in interface ResultListHandler
public logical deleteResultListEntry()
deleteResultListEntry
in interface P2JQuery
deleteResultListEntry
in interface ResultListHandler
true
on success.public logical deleteResultListEntry(boolean allowBetweenRows)
deleteResultListEntry
in interface P2JQuery
allowBetweenRows
- If true
then the cursor can be positioned between rows (the next
row will be deleted). false
for conventional DELETE-RESULT-LIST-ENTRY()
mode where the cursor should be positioned on a row (otherwise false
is
returned).true
on success.public void setParameterFilter(ParameterFilter parameterFilter)
setParameterFilter
in interface P2JQuery
parameterFilter
- The filter that handles passed parameters.public integer numBuffers()
numBuffers
in interface P2JQuery
public void setSkipDeletedRecord(logical on)
setSkipDeletedRecord
in interface P2JQuery
on
- New value for the attribute.public logical isSkipDeletedRecord()
isSkipDeletedRecord
in interface P2JQuery
public void include(DataModelObject dmo, java.lang.String... fields)
include
in interface P2JQuery
dmo
- DMO proxy which defines the buffer for which the fields are specified.fields
- The fields included in a record retrieval. If no fields are specified, only record
identifiers are retrieved. No subscripts can be specified for extent fields.public void exclude(DataModelObject dmo, java.lang.String... fields)
private void addBuffers(Joinable query, boolean clear)
Will be a no-op when this is a dynamic
query.
query
- The P2J query from which the buffers are loaded.clear
- When true
, it will clear the buffers
list and the predicate.private boolean validBuffer(handle h, int idx)
Buffer
.h
- The handle to be checked.idx
- The index of this handle in a setBuffers(com.goldencode.p2j.util.handle...)
call.true
if the handle is valid and the referrent is a Buffer
.private boolean canAddBuffer()
true
if a buffer can be added.private boolean canGet()
true
if the query is not closed.private boolean canGetFirst()
true
if the query can be advanced via GET-FIRST.private boolean canGetStmt()
true
if the query is not closed.private boolean canLastOrPrev()
true
if not in forward-only mode.private void assignImpl(P2JQuery delegate)
P2JQuery
instance as this container's active
delegate query. Set any deferred state which has been set for the
wrapper, such as scrollability and whether delegate should error out on
failed first/last/unique retrievals.delegate
- New delegate query.private void assignImpl(P2JQuery delegate, boolean open)
P2JQuery
instance as this container's active
delegate query. Set any deferred state which has been set for the
wrapper, such as scrollability and whether delegate should error out on
failed first/last/unique retrievals.delegate
- New delegate query.open
- true
if the query is considered to be open.private CompoundQuery compoundDelegate()
CompoundQuery
.CompoundQuery
.java.lang.IllegalStateException
- if the query delegate is not an instance of
CompoundQuery
.private PreselectQuery preselectDelegate()
PreselectQuery
.PreselectQuery
.java.lang.IllegalStateException
- if the query delegate is not an instance of
PreselectQuery
.private PresortDelegate presortDelegate()
PresortDelegate
.PresortDelegate
.java.lang.IllegalStateException
- if the query delegate is not an instance of
PresortDelegate
.private RandomAccessQuery randomAccessDelegate()
RandomAccessQuery
.RandomAccessQuery
.java.lang.IllegalStateException
- if the query delegate is not an instance of
RandomAccessQuery
.private void registerBufferRelatedQueries()
private void unregisterBufferRelatedQueries()
private P2JQuery getDelegate()
public java.lang.String getName()