public final class QueryWrapper extends HandleChain implements P2JQuery, ADMData, UniqueID, DynamicResource, ResultListHandler, CallbackProcedure
AbstractQuerys. 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, P2JQuery.ParamResolver, P2JQuery.QueryEventListener, P2JQuery.QueryOpenedListener| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
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.ArrayList<Buffer> |
buffers
The set of buffers used by this dynamic query.
|
private CallbackData |
callback
The only possible callback.
|
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 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 |
dynamicDelegate
Flag indicating if the query's
delegate is dynamic. |
private boolean |
errorIfNull
Should delegate's failed first/last/unique retrievals raise error?
|
private boolean |
explicit
Flags this query as an explicit query to allow the programmer to delete it.
|
private ResultListHandler |
externalResultListHandler
External handler for create/delete result list entry methods.
|
private boolean |
fetchOnReposition
Should the next row of the delegate be fetched after a reposition?
|
private boolean |
forwardOnly
Corresponds FORWARD-ONLY attribute.
|
private boolean |
indexedReposition
Should delegate be optimized using indexed reposition
|
private static CentralLogger |
LOG
Logger
|
private static InvokeConfig |
OFF_END_CALL_SITE
The call-site for the
OFF_END_EVENT event callback. |
private static java.lang.String |
OFF_END_EVENT
The
OFF-END event string constant in upper case. |
private boolean |
offEnd
Current off-end state.
|
private java.util.ArrayList<P2JQuery.QueryOpenedListener> |
openedListeners
Opened listeners registered to get the message about query has been opened.
|
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 DataRelation |
relation
The recursive DATA-RELATION the query is to FILL for
|
private WeakList<RepositionListener> |
repoListeners
Reposition listeners registered with the delegate query
|
private boolean |
scrolling
Should delegate be a scrolling query?
|
private boolean |
skipDeletedRecordDisposition
The initial disposition for the value of SKIP-DELETED-RECORD.
|
private java.util.List<Buffer> |
substBuffers
The list of substitution buffers.
|
private java.lang.Long |
uniqueID
Corresponds UNIQUE-ID attribute.
|
private boolean |
valid
Check if this query is valid.
|
private java.util.Set<QueryWrapperListener> |
wrapperListeners
Query wrapper listeners.
|
name, nextSibling, prevSibling, wainstProc, pm| Modifier | Constructor and Description |
|---|---|
|
QueryWrapper(java.lang.String name,
boolean scrolling)
Deprecated.
This method was kept only to make the code already compiled against previous revision of FWD
work. Although the code is unchanged the runtime will attempt to use of this signature as
chosen by linker instead of
QueryWrapper(String, boolean, String...). |
private |
QueryWrapper(java.lang.String name,
boolean scrolling,
boolean dynamic)
Constructor which sets query scrolling mode for all delegate queries assigned to this
wrapper.
|
|
QueryWrapper(java.lang.String name,
boolean scrolling,
java.lang.String... browseNames)
Constructor which creates a static query and 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 |
_getNext()
Conversion of GET-NEXT method (KW_GET_NEXT), which returns a Java boolean, for internal usage.
|
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 DataSet object,
without affecting the other buffers, if any.
|
logical |
addBuffer(Buffer buf,
boolean staticCall)
Adds one new buffer to a query object or dynamic DataSet object,
without affecting the other buffers, if any.
|
logical |
addBuffer(character bufName)
Adds one new buffer to a query object or dynamic DataSet object,
without affecting the other buffers, if any.
|
logical |
addBuffer(handle bufHandle)
Adds one new buffer to a query object or dynamic DataSet object,
without affecting the other buffers, if any.
|
logical |
addBuffer(java.lang.String bufName)
Adds one new buffer to a query object or dynamic DataSet 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.
|
boolean |
addDynamicFilter(FieldReference fr,
BaseDataType val,
java.lang.String format)
Adds a new constraint term to the where predicate of this query, effectively filtering out
any rows whose referenced field does not match the requested value.
|
void |
addDynamicSort(FieldReference[] fieldReferences,
boolean[] asc)
Adds new sorting criteria as the most coarse set of criteria for sorting the result of this
query.
|
void |
addDynamicSort(FieldReference fr,
boolean asc)
Adds a new sorting criterion as the strongest criterion for sorting the result of this
query.
|
P2JQuery |
addExternalBuffers(DataModelObject... dmos)
Add one or more buffers to the list of those which this query references externally.
|
void |
addOpenedListener(P2JQuery.QueryOpenedListener listener)
Register a listener to receive notifications about the query has been opened.
|
void |
addQueryEventListener(P2JQuery.QueryEventListener listener)
Adds a listener to be notified when this query is opened or closed.
|
void |
addQueryWrapperListener(QueryWrapperListener listener)
Adds a listener to be notified about the query wrapper events.
|
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.
|
boolean |
allowDelete(handle ref,
boolean explicit)
Check if the resource can veto the delete or not, before attempting the
HandleChain.delete() call. |
logical |
applyCallback(java.lang.String eventName)
Applies a callback procedure, which allows execution of a defined event without duplicating the event
procedure definition.
|
handle |
asHandle()
Generate a handle to the query object.
|
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(int64 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).
|
Buffer |
bufferHandleNative()
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.
|
private boolean |
canReposition()
Check if the query is opened.
|
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 |
clearDynamicFilters()
Clears any dynamically filters added at runtime.
|
void |
clearDynamicSorts()
Clears any dynamically sort criteria added at runtime.
|
void |
clearResults()
Clear the current results from the query, so the same query instance can be executed again, without
having to
re-open it. |
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.
|
static QueryWrapper |
createQueryUnnamedPool()
Dynamically creates a query in the specified widget pool.
|
logical |
createResultListEntry()
Creates an entry in the result list for the current row.
|
logical |
createResultListEntryWorker()
Calls delegate's
P2JQuery.createResultListEntry(). |
boolean |
current()
Reload the record most recently loaded into the backing record buffer,
if any.
|
boolean |
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 |
deleteResultListEntryWorker()
Calls delegate's
P2JQuery.deleteResultListEntry(). |
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.
|
boolean |
first()
Navigate to the first record which meets the query criteria and retrieve
it into its record buffer.
|
boolean |
first(boolean iterating)
Retrieve the first virtual, composite row of results for a compound
query.
|
boolean |
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.
|
boolean |
first(LockType lockType)
Navigate to the first record which meets the query criteria and retrieve
it into its record buffer.
|
boolean |
first(java.lang.Object[] values)
Navigate to the first record which meets the query criteria and retrieve
it into its record buffer.
|
boolean |
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.
|
Buffer |
getBufferByIndex(int bufferSequenceNumber)
Conversion of GET-BUFFER-HANDLE() method (KW_GET_BUFH).
|
integer |
getCache()
Getter for the CACHE attribute.
|
handle |
getCallbackProcContext(java.lang.String eventName)
Retrieves the handle of the procedure that contains the internal procedure associated with the ABL
callback for the specified event
|
character |
getCallbackProcName(java.lang.String eventName)
Retrieves the name of the internal procedure associated with the ABL callback for the specified event.
|
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).
|
DataRelation |
getDataRelation()
Get the recursive DATA-RELATION the query is to FILL for.
|
private DataSet |
getDataSet()
Obtains the
Dataset of the first buffer of this query, if this is defined. |
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(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.ArrayList<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).
|
RecordBuffer[] |
getRecordBuffers()
Get a list of all buffers in this query.
|
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 |
hintFullResults()
Mark the query to retrieve the entire result set (useful for FILL operations).
|
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).
|
protected boolean |
invokeCallback(handle self,
CallbackData cbd)
Invokes a callback procedure or a callback method.
|
boolean |
isBrowsed()
Is this query associated with a browse widget or not?
|
private static boolean |
isCallbackName(java.lang.String someName)
Test whether a string is a valid CALLBACK name for a
DataSet Query. |
(package private) boolean |
isExplicit()
Test whether this is an explicit query.
|
boolean |
isFetchOnReposition()
Is this query set to fetch the next record after a reposition?
|
boolean |
isFillingBrowseRows()
Checks whether the query that the next operations will be performed for filling browse rows, so it
should not return deleted rows/records (if argument is
true). |
logical |
isFirst()
Determine whether the query result row currently being visited is the
first row in the presorted results list.
|
logical |
isFirstOfGroup(int level)
Determine whether the query result row currently being visited is the first row of the
query's result set or the first row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isFirstOfGroup(integer level)
Determine whether the query result row currently being visited is the first row of the
query's result set or the first row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isFirstOfGroup(Resolvable key)
Determine whether the query result row currently being visited is the
first row within a break group whose category is identified by the
specified resolvable object.
|
boolean |
isIndexedReposition()
Indicate whether this query is optimized using indexed reposition.
|
boolean |
isIterating()
Indicate whether the delegate query is defined inside the scope of FOR EACH block.
|
logical |
isLast()
Determine whether the query result row currently being visited is the
last row in the presorted results list.
|
logical |
isLastOfGroup(int level)
Determine whether the query result row currently being visited is the last row of the
query's result set or the last row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isLastOfGroup(integer level)
Determine whether the query result row currently being visited is the last row of the
query's result set or the last row within a break group whose category is identified by
the specified BREAK-BY level.
|
logical |
isLastOfGroup(Resolvable key)
Determine whether the query result row currently being visited is the
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 |
isPresort()
Indicate whether the delegate query is of presort type.
|
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.
|
boolean |
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.
|
boolean |
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.
|
private void |
maybeFireCallback()
Test whether the OFF-END event occurred and if so, fire the callback if one is defined.
|
boolean |
next()
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
boolean |
next(boolean iterating)
Retrieve the next virtual, composite row of results for a compound
query.
|
boolean |
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.
|
boolean |
next(LockType lockType)
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
boolean |
next(java.lang.Object[] values)
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
boolean |
next(java.lang.Object[] values,
LockType lockType)
Navigate to the next record which meets the query criteria and retrieve
it into its record buffer.
|
(package private) void |
notifyBeforeOpenListeners()
Notify query wrapper event listeners that the query is about to be opened.
|
void |
notifyListeners()
Deprecated.
Use #open() instead.
|
protected void |
notifyQueryDeleted()
Notify all registered listeners the query is deleted.
|
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.
|
private Buffer |
parseBuffer(BufferManager bm,
java.lang.String bufName,
int bufIdx)
Identify the buffer which matches the given buffer name.
|
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. |
boolean |
previous()
Navigate to the previous record which meets the query criteria and
retrieve it into its record buffer.
|
boolean |
previous(boolean iterating)
Retrieve the previous virtual, composite row of results for a compound
query.
|
boolean |
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.
|
boolean |
previous(LockType lockType)
Navigate to the previous record which meets the query criteria and
retrieve it into its record buffer.
|
boolean |
previous(java.lang.Object[] values)
Navigate to the previous record which meets the query criteria and
retrieve it into its record buffer.
|
boolean |
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(character rowId)
Conversion of REPOSITION-TO-ROWID() method (KW_REPOS_2I).
|
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 |
registerCleaner()
Register the cleaner which closes the query when the external [persistent] procedure in
which the query was opened is deleted.
|
void |
releaseBuffers()
Release the buffers.
|
void |
removeOpenedListener(P2JQuery.QueryOpenedListener listener)
De-register a listener to receive notifications about the query has been opened.
|
void |
removeQueryWrapperListener(QueryWrapperListener listener)
Remove a listener from being notified about the query wrapper events.
|
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.
|
boolean |
repositionByID(java.lang.Long... 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.
|
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.
|
void |
resetQuery()
Reset the query (this does not close the query).
|
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.
|
void |
setBrowsed(ResultListHandler resultListHandler)
Sets an external result list handler and marks the query as browsed.
|
logical |
setBuffers(Buffer... bufs)
Sets buffers for the query.
|
logical |
setBuffers(handle... hBuffers)
Sets buffers for the query.
|
logical |
setBuffers(java.lang.Object... bufs)
Sets buffers for the query.
|
void |
setCache(integer n)
Setter for the CACHE attribute.
|
void |
setCache(long n)
Setter for the CACHE attribute.
|
logical |
setCallback(java.lang.String callbackName,
java.lang.String routineName,
object<?> context)
Configures a callback.
|
logical |
setCallbackProcedure(java.lang.String eventName,
java.lang.String callback,
handle context)
Associates an internal procedure with an ABL callback event.
|
void |
setDataRelation(DataRelation relation)
Set the recursive DATA-RELATION the query is to FILL for.
|
private void |
setDelegateIndexedReposition()
Helper for making delegate query indexed reposition while checking the eligibility.
|
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.
|
void |
setFetchOnReposition(boolean enable)
Set this query to automatically fetch the next record after a
reposition, or turn this feature off.
|
void |
setFillingBrowseRows(boolean on)
Informs the query that the next operations will be performed for filling browse rows, so it should not
return deleted rows/records (if argument is
true). |
(package private) void |
setImplicit()
Mark this query as implicit.
|
void |
setIndexedReposition()
Ensure that any
AbstractQuery assigned to this wrapper is
a optimized query using indexed reposition. |
void |
setIterating(boolean iterating)
Indicate whether the query is defined inside the scope of FOR EACH block.
|
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 |
setLenientOffEnd(boolean lenientOffEnd)
Set the behavior of this query as a record retrieval request moves off
the end of its results.
|
void |
setParameterFilter(ParameterFilter parameterFilter)
Set the filter that handles parameters passed to the query.
|
void |
setPresort(boolean presort)
Indicate whether the delegate query is of presort type.
|
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.
|
(package private) void |
setSubstitutionBuffers(Buffer... substs)
Instruct dynamic conversion to add a list of substitution buffers.
|
(package private) void |
setSubstitutionBuffers(Buffer datasetBuffer)
Instruct dynamic conversion to use the list of 'parent' buffers of
datasetBuffer as substitution
buffers. |
integer |
size()
Get the current size of the cached results list.
|
boolean |
unique()
Navigate to a particular record which meets the query criteria and
retrieve it into its record buffer.
|
boolean |
unique(LockType lockType)
Navigate to a particular record which meets the query criteria and
retrieve it into its record buffer.
|
boolean |
unique(java.lang.Object[] values)
Navigate to a particular record which meets the query criteria and
retrieve it into its record buffer.
|
boolean |
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. |
_name, delete, firstResource, firstResource, getHead, getNextSibling, getNextSibling, getPrevSibling, getPrevSibling, getPrivateData, getTail, hasName, hasNameConstraints, hasNameReadOnly, hasNextSibling, hasParent, hasPrevSibling, hasPrivateData, interlink, isChained, lastResource, lastResource, moveInChain, name, name, name, readOnlyError, readOnlyError, resolveChainType, setHead, setNextSibling, setNextSibling, setPrevSibling, setPrevSibling, setPrivateData, setPrivateData, setPrivateData, validateName_instantiatingProcedure, addToPool, doDelete, equals, hashCode, id, id, implicitDeletion, incrementTrigger, instantiatingProcedure, invalidAttribute, processResource, registerResource, resourceType, setInstantiatingProcedure, toString, type, unableToAssignUnknown, unknownclone, finalize, getClass, notify, notifyAll, wait, wait, waitclose, getBasicLogging, getJoin, getNext, isDynamicPredicate, isFindByRowid, notifyQueryCloseListeners, notifyQueryOpenListeners, setBasicLogging, setBasicLogging, setDynamicPredicateapplyCallback, getCallbackProcContext, getCallbackProcName, setCallback, setCallback, setCallback, setCallback, setCallback, setCallback, setCallbackProcedure, setCallbackProcedure, setCallbackProcedure, setCallbackProcedure, setCallbackProcedure, setCallbackProcedure, setCallbackProcedureresourceTypeid, id, unknownprivate static final CentralLogger LOG
private static final P2JQuery DEFAULT_DELEGATE
private static final java.lang.String OFF_END_EVENT
OFF-END event string constant in upper case.private static final InvokeConfig OFF_END_CALL_SITE
OFF_END_EVENT event callback.private P2JQuery delegate
private final WeakList<RepositionListener> repoListeners
private boolean scrolling
private boolean indexedReposition
private boolean errorIfNull
private boolean fetchOnReposition
private boolean browsed
private final java.util.ArrayList<P2JQuery.QueryOpenedListener> openedListeners
private java.util.Set<QueryWrapperListener> wrapperListeners
private boolean closed
private boolean offEnd
private boolean advanced
private boolean dynamic
private boolean dynamicDelegate
delegate is dynamic. This can be true even for a static query
resource.private java.lang.String admData
private java.lang.Long uniqueID
private boolean forwardOnly
private java.lang.String prepareString
prepare(java.lang.String).private final java.util.ArrayList<Buffer> buffers
private boolean valid
private final java.lang.String qname
private boolean cleanerRegistered
private boolean skipDeletedRecordDisposition
true for normal queries and
false for static browsed queries.private java.util.List<Buffer> substBuffers
null), each buffer in a
dynamic query must appear exactly one time in FOR clause.private ResultListHandler externalResultListHandler
private CallbackData callback
null if not set.private DataRelation relation
private boolean explicit
@Deprecated
public QueryWrapper(java.lang.String name,
boolean scrolling)
QueryWrapper(String, boolean, String...).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.public QueryWrapper(java.lang.String name,
boolean scrolling,
java.lang.String... browseNames)
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.browseNames - The legacy name of any BROWSEs widgets which use this query.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.public void clearResults()
re-open it.clearResults in interface P2JQuerypublic void hintFullResults()
hintFullResults in interface P2JQueryprivate 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 static QueryWrapper createQueryUnnamedPool()
CREATE QUERY from 4GL.public logical dynamic()
true if the buffer is dynamic.dynamic in interface DynamicResourcetrue if the resource is dynamic, false otherwise.public boolean _dynamic()
true if the buffer is dynamic._dynamic in interface DynamicResourcetrue 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 P2JQuerypublic boolean isScrolling()
isScrolling in interface P2JQuerytrue if this query is scrolling.public void setIterating(boolean iterating)
setIterating in interface P2JQueryiterating - true indicating that a query is inside FOR EACH block;
false is defined outside of a FOR EACH.public boolean isIterating()
isIterating in interface P2JQuerytrue if the query was defined inside a FOR EACH block.public boolean isPresort()
public void setPresort(boolean presort)
setPresort in interface P2JQuerypresort - true indicating that a query of presort type.
false is not of presort type.public void setIndexedReposition()
AbstractQuery assigned to this wrapper is
a optimized query using indexed reposition. This flag can be set only if
the query is scrolling. An indexed reposition query can be repositioned
to an unflushed record (one which was not in the database when the
query was opened). Repositioning to such record will empty the result list.setIndexedReposition in interface P2JQueryErrorConditionException - if the underlying delegate is not scrolling.public boolean isIndexedReposition()
isIndexedReposition in interface P2JQuerytrue if this query is indexed reposition.public void close()
public void resetQuery()
resetQuery in interface P2JQuerypublic int getTableCount()
getTableCount in interface P2JQuerypublic java.util.ArrayList<QueryOffEndListener> getOffEndListeners()
getOffEndListeners in interface P2JQuerypublic P2JQuery addExternalBuffers(DataModelObject... dmos)
addExternalBuffers in interface P2JQuerydmos - 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 P2JQueryerrorIfNull - 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 setLenientOffEnd(boolean lenientOffEnd)
next and previous which do not find a record
do not raise a QueryOffEndException. By default, this
would normally raise the exception.setLenientOffEnd in interface P2JQuerylenientOffEnd - true to suppress QueryOffEndException
for next and previous requests;
false to permit these exceptions.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 P2JQueryaccum - 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 P2JQueryaccum - 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 WrappedResourcetrue 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 boolean first()
first in interface P2JQuerytrue if query could retrive the first record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.public boolean first(LockType lockType)
first in interface P2JQuerylockType - Lock type to acquire for the retrieved record.true if query could retrive the first record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.public boolean 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 boolean 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 boolean 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 boolean 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 boolean last()
last in interface P2JQuerytrue if query could retrive the last record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval or if no record
could be found when operating in standalone mode.public boolean last(LockType lockType)
last in interface P2JQuerylockType - Lock type to acquire for the retrieved record.true if query could retrive the last record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval or if no record
could be found when operating in standalone 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 boolean 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 P2JQuerytrue if query could retrive the next record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval.public boolean 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 P2JQuerylockType - Lock type to acquire for the retrieved record.true if query could retrive the next record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval.public boolean 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 boolean 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 boolean 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 boolean 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 boolean 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 P2JQuerytrue if query could retrive the previous record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval.public boolean 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 P2JQuerylockType - Lock type to acquire for the retrieved record.true if query could retrive the previous record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record retrieval.public boolean 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 boolean 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 boolean 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 boolean 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 boolean current()
current in interface P2JQuerytrue if query could retrive the current record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record reload.public boolean current(LockType lockType)
current in interface P2JQuerylockType - New lock type to apply to the record.true if query could retrive the current record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if an error occurred during record reload, or the lock could
not be transitioned to the requested type.public boolean unique()
unique in interface P2JQuerytrue if query could retrive the unique record succefully;
false if unsuccessful and lenientOffEnd is set on true.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 boolean unique(LockType lockType)
unique in interface P2JQuerylockType - Lock type to acquire for the retrieved record.true if query could retrive the unique record succefully;
false if unsuccessful and lenientOffEnd is set on true.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 boolean 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 boolean 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 P2JQueryvalues - 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 P2JQueryvalues - 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 P2JQuerytrue if set to fetch after reposition, else
false.public void setFetchOnReposition(boolean enable)
setFetchOnReposition in interface P2JQueryenable - true to enable automatic fetching;
false to disable.public void addQueryEventListener(P2JQuery.QueryEventListener listener)
Note that this method is only called for dynamic queries only (for the moment).
addQueryEventListener in interface P2JQuerylistener - The listener to be notified.public void addOpenedListener(P2JQuery.QueryOpenedListener listener)
listener - The listener to be notified.public void removeOpenedListener(P2JQuery.QueryOpenedListener listener)
listener - The listener to be removed.public void addRepositionListener(RepositionListener listener)
addRepositionListener in interface P2JQuerylistener - Reposition listener to be registered.public void removeRepositionListener(RepositionListener listener)
removeRepositionListener in interface P2JQuerylistener - Reposition listener to be unregistered.public void setBrowsed(ResultListHandler resultListHandler)
resultListHandler - External result list handler.public void setBrowsed(boolean browsed)
setBrowsed in interface P2JQuerybrowsed - true to indicate the query has an associated
browse widget, else false.public boolean isBrowsed()
public void repositionByID(recid id)
repositionByID in interface P2JQueryid - 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 P2JQueryid1 - 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.
If an array element is unknown, this element and all subsequent elements
are ignored.ErrorConditionException - if this query is not a scrolling query;
if any of the specified IDs represents the unknown value.public boolean repositionByID(java.lang.Long... joinIDs)
repositionByID in interface P2JQueryjoinIDs - A set of primary key IDs, arranged from left to right to coincide with the records
being joined by the underlying query.true on success.ErrorConditionException - if any of the specified IDs represents the unknown value.public void reposition(NumberType row)
reposition in interface P2JQueryrow - 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 P2JQueryrow - 1-based index of the target position.ErrorConditionException - if this query is not a scrolling query.public boolean forward(NumberType rows)
forward in interface P2JQueryrows - 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 P2JQueryrows - 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 P2JQueryrows - 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 P2JQueryrows - 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 P2JQueryErrorConditionException - if this query is not a scrolling query.public DataRelation getDataRelation()
getDataRelation in interface P2JQuerypublic void setDataRelation(DataRelation relation)
setDataRelation in interface P2JQueryrelation - the recursive DATA-RELATION the query is to FILL forpublic integer currentRow()
currentRow in interface P2JQuerypublic integer currentRowImpl()
currentRowImpl in interface P2JQueryErrorConditionException - 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 P2JQuerytrue 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 P2JQuerytrue 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 isFirstOfGroup(integer level)
isFirstOfGroup in interface P2JQuerylevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.
Must not be unknown value.true if the current row is first in the result set or within the specified
break group; else false.public logical isFirstOfGroup(int level)
isFirstOfGroup in interface P2JQuerylevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.true if the current row is first in the result set or within the specified
break group; else false.public logical isLast()
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 logical isLastOfGroup(integer level)
isLastOfGroup in interface P2JQuerylevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.
Must not be unknown value.true if the current row is last in the result set or within the specified
break group; else false.public logical isLastOfGroup(int level)
isLastOfGroup in interface P2JQuerylevel - Break group level, where 0 is the whole query, 1 is the first BREAK-BY sort
criterion, etc. Must not be negative or greater than the number of sort criteria.true if the current row is last in the result set or within the specified
break group; else false.public boolean isPreselect()
isPreselect in interface P2JQuerytrue if the query preselects its results;
false if the query's results are dynamically
navigated.public boolean isNativelyPreselect()
isNativelyPreselect in interface P2JQuerytrue.public void notifyRepositionListeners(boolean closed,
boolean error,
int targetRepositionRow)
notifyRepositionListeners in interface P2JQueryclosed - 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.@Deprecated public void notifyListeners()
public boolean isStandalone()
isStandalone in interface P2JQuerytrue; 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 P2JQuerystandalone - 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 P2JQueryP2JQuery.cleanup()public handle asHandle()
public handle bufferHandle()
bufferHandle in interface BufferCollectionpublic Buffer bufferHandleNative()
public handle bufferHandle(java.lang.String bufferName)
bufferHandle in interface BufferCollectionbufferName - buffer-name. A CHARACTER expression that evaluates to the name
of a buffer in the query or DataSet object.public handle bufferHandle(character bufferName)
bufferHandle in interface BufferCollectionbufferName - buffer-name. A CHARACTER expression that evaluates to the name
of a buffer in the query or DataSet object.public handle bufferHandle(int bufferSequenceNumber)
bufferHandle in interface BufferCollectionbufferSequenceNumber - buffer-sequence-number. An INTEGER that represents the sequence
number of the desired buffer.public handle bufferHandle(int64 bufferSequenceNumber)
bufferHandle in interface BufferCollectionbufferSequenceNumber - buffer-sequence-number. An INTEGER that represents the sequence
number of the desired buffer.public Buffer getBufferByIndex(int bufferSequenceNumber)
bufferSequenceNumber - buffer-sequence-number. An INTEGER that represents the sequence
number of the desired buffer.public logical queryClose()
queryClose in interface P2JQuerytrue if QUERY-CLOSE() succeeds,
else false.public logical queryBackward(int rows)
queryBackward in interface P2JQuerytrue if REPOSITION-BACKWARD() succeeds,
else false.public logical queryBackward(NumberType rows)
queryBackward in interface P2JQuerytrue 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 P2JQuerytrue if REPOSITION-FORWARD() succeeds,
else false.public logical queryForward(NumberType rows)
queryForward in interface P2JQuerytrue 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 P2JQueryn - An integer expression representing the sequence number.true if REPOSITION-TO-ROW() succeeds,
else false.public logical queryReposition(NumberType n)
queryReposition in interface P2JQueryn - 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 P2JQueryid1 - 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 logical queryRepositionByID(character rowId)
queryRepositionByID in interface P2JQueryrowId - A character representation of this rowid.true if REPOSITION-TO-ROWID() succeeds,
else false.public integer getNumResults()
getNumResults in interface P2JQuerypublic logical addBuffer(handle bufHandle)
addBuffer in interface BufferCollectionbufHandle - A buffer handle to add.public logical addBuffer(Buffer buf)
addBuffer in interface BufferCollectionbuf - A buffer to add.public logical addBuffer(character bufName)
addBuffer in interface BufferCollectionbufName - A buffer name use to identify a buffer to be added.public logical addBuffer(java.lang.String bufName)
addBuffer in interface BufferCollectionbufName - A buffer name use to identify a buffer to be added.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 BufferCollectionhBuffers - 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 BufferCollectionbufs - Variable argument list of Buffer to be set.
In 4GL, the maximum number of buffers per query is 18.public logical setBuffers(java.lang.Object... 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 BufferCollectionbufs - 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 IndexInformationindexInformation in interface P2JQuerypublic character indexInformation(int n)
indexInformation in interface IndexInformationindexInformation in interface P2JQueryn - An integer expression that evaluates to the level of join for which you want
index information.public character indexInformation(NumberType n)
indexInformation in interface IndexInformationindexInformation in interface P2JQueryn - An integer expression that evaluates to the level of join for which you want index
information.public logical forwardOnly()
forwardOnly in interface P2JQuerypublic void changeForwardOnly(logical forwardOnly)
changeForwardOnly in interface P2JQueryforwardOnly - New value of FORWARD-ONLY attribute.public void changeForwardOnly(boolean forwardOnly)
changeForwardOnly in interface P2JQueryforwardOnly - New value of FORWARD-ONLY attribute.public character prepareString()
prepareString in interface P2JQuerypublic integer getCache()
public void setCache(integer n)
public void setCache(long n)
public logical isOpen()
public character getADMData()
getADMData in interface ADMDatapublic void setADMData(java.lang.String value)
setADMData in interface ADMDatavalue - The new value.public void setADMData(character value)
setADMData in interface ADMDatavalue - The new value.public integer getUniqueID()
getUniqueID in interface UniqueIDprotected boolean resourceDelete()
resourceDelete in class HandleResourcetrue if the resource was deleted.public boolean _getNext()
public logical getNext(LockType lockType)
getNext in interface P2JQuerylockType - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerytrue 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 P2JQuerylock - 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 P2JQuerylockType - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylockType - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylockType - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerylock - 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 P2JQuerytrue if GET-CURRENT() succeeds, else false.public logical getCurrent(long lock)
getCurrent in interface P2JQuerylock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if GET-CURRENT() succeeds, else false.public logical getCurrent(NumberType lock)
getCurrent in interface P2JQuerylock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if GET-CURRENT() succeeds, else false.public logical getCurrent(LockType lockType)
getCurrent in interface P2JQuerylockType - of LockTypetrue if GET-CURRENT() succeeds, else false.public logical getCurrent(long lock, long nowait)
getCurrent in interface P2JQuerylock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.public logical getCurrent(NumberType lock, long nowait)
getCurrent in interface P2JQuerylock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.public logical getCurrent(long lock, NumberType nowait)
getCurrent in interface P2JQuerylock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.public logical getCurrent(NumberType lock, NumberType nowait)
getCurrent in interface P2JQuerylock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.public logical createResultListEntry()
createResultListEntry in interface P2JQuerycreateResultListEntry in interface ResultListHandlertrue on success.public logical createResultListEntryWorker()
P2JQuery.createResultListEntry().P2JQuery.createResultListEntry().public logical deleteResultListEntryWorker()
P2JQuery.deleteResultListEntry().P2JQuery.deleteResultListEntry().public logical deleteResultListEntry()
deleteResultListEntry in interface P2JQuerydeleteResultListEntry in interface ResultListHandlertrue on success.public logical deleteResultListEntry(boolean allowBetweenRows)
deleteResultListEntry in interface P2JQueryallowBetweenRows - 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 P2JQueryparameterFilter - The filter that handles passed parameters.public integer numBuffers()
numBuffers in interface BufferCollectionpublic void setSkipDeletedRecord(logical on)
setSkipDeletedRecord in interface P2JQueryon - New value for the attribute.public void setFillingBrowseRows(boolean on)
true). That is, temporarily overwrite the
SKIP-DELETED-RECORDS until the flag is turned off.setFillingBrowseRows in interface P2JQueryon - if true the deleted rows will not be returned because the query is managed by the
browse widget.public boolean isFillingBrowseRows()
true). That is, temporarily overwrite the
SKIP-DELETED-RECORDS until the flag is turned off.isFillingBrowseRows in interface P2JQuerytrue if the deleted rows will not be returned because the query is managed by the
browse widget.P2JQuery.setFillingBrowseRows(boolean)public logical isSkipDeletedRecord()
isSkipDeletedRecord in interface P2JQuerypublic logical setCallbackProcedure(java.lang.String eventName, java.lang.String callback, handle context)
setCallbackProcedure in interface CallbackProcedureeventName - The eventName of the event.callback - The eventName of the internal procedure associated with the callback event.context - A handle to a procedure that contains the internal procedure specified by callback. If
not specified, THIS-PROCEDURE is used as the procedure context.true when the method ends with success.public logical setCallback(java.lang.String callbackName, java.lang.String routineName, object<?> context)
setCallback in interface CallbackProcedurecallbackName - The name of a callback.routineName - The name of a method or an internal procedure to be associated.context - The context in which the callback will be executed.true if callbackName is a correct callback name. The rest of parameters are
ignored (note: manual states otherwise).public logical applyCallback(java.lang.String eventName)
applyCallback in interface CallbackProcedureeventName - The event whose callback will be called.true if operation is successful.public character getCallbackProcName(java.lang.String eventName)
getCallbackProcName in interface CallbackProcedureeventName - The name of the event.public handle getCallbackProcContext(java.lang.String eventName)
getCallbackProcContext in interface CallbackProcedureeventName - The name of the event.public void include(DataModelObject dmo, java.lang.String... fields)
include in interface P2JQuerydmo - 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)
public RecordBuffer[] getRecordBuffers()
getRecordBuffers in interface P2JQueryprivate void maybeFireCallback()
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 Buffer parseBuffer(BufferManager bm, java.lang.String bufName, int bufIdx)
BufferManager to identify the proper buffer.bm - An instance of the BufferManager. This can be null, case in which
it will be initialized with a buffer manager from the local context.bufName - The buffer name which should be used to identify the searched buffer.bufIdx - The index of the buffer inside the query, such that in case the buffer
searching fails, it will prompt and error indicating the buffer index.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 canReposition()
true if the query is not closed.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 unregisterBufferRelatedQueries()
private P2JQuery getDelegate()
public java.lang.String getName()
public void releaseBuffers()
delegate query.releaseBuffers in interface P2JQuerypublic boolean addDynamicFilter(FieldReference fr, BaseDataType val, java.lang.String format)
new-where := (fr = val) AND (old-query).
Note: The constraints are exclusive meaning that if constraints will be added for same field of same buffer, the query will return an empty result because the field cannot be at the same time equals to two different values.
Use clearDynamicFilters() to clean all dynamically added criteria and restore the
sorting order of the query to its original form.
addDynamicFilter in interface P2JQueryfr - A reference to field used as filtering criterion. Only the rows that matches the
specified value for this field will be selected. Must not be null.val - The filtering value for this constraint. Can be null or unknown, in
which case the SQL null value will be assumed. In this case the predicate
will look like:
new-where := (fr IS NULL) AND (old-query)
format - The format to be used when comparing values. The reason for this parameter is that
for some datatype (ex: decimal) the on-screen value can be different from
the database (because of rounding).true if the filtering constraint was successfully added. If the field
reference is not related to the buffer(s) of this query, false is returned.public void clearDynamicFilters()
clearDynamicFilters in interface P2JQuerypublic void clearDynamicSorts()
public void addDynamicSort(FieldReference fr, boolean asc)
Use clearDynamicSorts() to clean all dynamically added criteria and restore the
sorting order of the query to its original form.
fr - A reference to field used as new strongest criterion. The current criteria will
be kept, but with lower priority.asc - The direction of sorting for this criterion. Use true for ascending sort
and false for descending sorting.public void addDynamicSort(FieldReference[] fieldReferences, boolean[] asc)
Use clearDynamicSorts() to clean all dynamically added criteria and restore the
sorting order of the query to its original form.
fieldReferences - References to fields used as new most coarse criteria. The current criteria will
be kept, but with lower priority. Inside the array criteria are positioned from
the most coarse to the most granular.asc - Direction of sorting for the new criteria. Use true for ascending sort
and false for descending sorting. Inside the array directions are
positioned from the most coarse criterion to the most granular.public void addQueryWrapperListener(QueryWrapperListener listener)
listener - The listener to be notified.public void removeQueryWrapperListener(QueryWrapperListener listener)
listener - The listener to be removed.public boolean allowDelete(handle ref, boolean explicit)
HandleChain.delete() call.allowDelete in interface Deletableref - The exact handle holding the reference, on which the delete is attempted.explicit - Flag indicating this is called via DELETE OBJECT from the application.false if the delete is vetoed.boolean isExplicit()
true if this is a normal (explicitly) created query.void setImplicit()
void notifyBeforeOpenListeners()
void setSubstitutionBuffers(Buffer datasetBuffer)
datasetBuffer as substitution
buffers. These are not the main buffers the query is iterating but may appear in SUBST nodes (as
substitutions).datasetBuffer - The Buffer this query is used to populate in a fill() operation. If this is
not a database buffer or the buffer is a top-level buffer, no substitution buffers are added.void setSubstitutionBuffers(Buffer... substs)
substs - A list of node that the query may use in substitution nodes.protected void notifyQueryDeleted()
protected boolean invokeCallback(handle self, CallbackData cbd)
INPUT parameter of type DATASET or DATASET-HANDLE. The passed parameter is this
DataSet object.cbd - A CallbackData object holding the data necessary for invocation. May be null,
in which case this method will silently return yes even though nothing is performed.self - The object on which the event is applied (buffer or dataset).true if no errors were encountered during execution.private DataSet getDataSet()
Dataset of the first buffer of this query, if this is defined.Dataset of the first buffer of this query, if this is defined.private static boolean isCallbackName(java.lang.String someName)
DataSet Query. This method is responsible
for raising the 12352 error if the name specified is unknown or not OFF-END - the only supported
event for dataset queries.someName - The name to test.true only if someName is equals to "OFF-END".private void setDelegateIndexedReposition()