public interface P2JQuery extends BufferCollection, IndexInformation, Openable
| Modifier and Type | Interface and Description |
|---|---|
static interface |
P2JQuery.Parameter
Functional interface used with lambda expressions to defer evaluation of certain query
substitution parameter expressions.
|
static interface |
P2JQuery.ParamResolver
Functional interface used with lambda expressions to late defer evaluation of certain query
substitution parameter expressions.
|
static interface |
P2JQuery.QueryEventListener
Interface for receiving query events.
|
static interface |
P2JQuery.QueryOpenedListener
Interface for receiving query open events after the query has been opened.
|
| Modifier and Type | Method and Description |
|---|---|
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.
|
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.
|
P2JQuery |
addExternalBuffers(DataModelObject... dmos)
Add one or more buffers to the list of those which this query references externally.
|
default void |
addQueryEventListener(P2JQuery.QueryEventListener qel)
Adds a listener to be notified when this query is opened or closed.
|
void |
addRepositionListener(RepositionListener listener)
Register a listener to receive notifications reposition events for this 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.
|
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()
Clean up resources associated with this query when its scope ends.
|
void |
clearDynamicFilters()
Clears any dynamically filters 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.
|
default void |
close(boolean inResource)
Explicitly close the prepared query.
|
logical |
createResultListEntry()
Creates an entry in the result list for the current row.
|
boolean |
current()
Reload the current composite row of results for the query.
|
boolean |
current(LockType lockType)
Reload the current composite row of results for the query, overriding
the lock type to apply to each record.
|
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.
|
void |
exclude(DataModelObject dmo,
java.lang.String... fields)
Specifies the fields excluded from a record retrieval.
|
boolean |
first()
Retrieve the first composite row of results for the query.
|
boolean |
first(LockType lockType)
Retrieve the first composite row of results for the query.
|
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).
|
default logical |
getBasicLogging()
Getter for the BASIC-LOGGING attribute.
|
integer |
getCache()
Getter for the CACHE attribute.
|
logical |
getCurrent()
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(LockType lockType)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(long lock)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(long lock,
long nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(long lock,
NumberType nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(NumberType lock)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(NumberType lock,
long nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
logical |
getCurrent(NumberType lock,
NumberType nowait)
Conversion of GET-CURRENT() method (KW_GET_CUR).
|
default DataRelation |
getDataRelation()
Get the recursive DATA-RELATION the query is to FILL for.
|
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).
|
default AbstractJoin |
getJoin()
Get the legacy natural join, if any, associated with this query.
|
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).
|
default logical |
getNext()
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(LockType lockType)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(long lock)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(long lock,
long nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(long lock,
NumberType nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(NumberType lock)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(NumberType lock,
long nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
logical |
getNext(NumberType lock,
NumberType nowait)
Conversion of GET-NEXT method (KW_GET_NEXT).
|
integer |
getNumResults()
Conversion of NUM-RESULTS attribute (KW_NUM_RES).
|
OffEnd |
getOffEnd()
Get the off-end status of this 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).
|
default RecordBuffer[] |
getRecordBuffers()
Get an array of all record buffers managed by this query.
|
int |
getTableCount()
Get the number of tables joined by this query.
|
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.
|
default 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).
|
boolean |
isBrowsed()
Is this query associated with a browse widget or not?
|
default boolean |
isDynamicPredicate()
Check if this query is originating from a dynamic predicate.
|
boolean |
isFetchOnReposition()
Is this query set to fetch the next record after a reposition?
|
default boolean |
isFillingBrowseRows()
Test whether the flag was set.
|
default boolean |
isFindByRowid()
Indicate whether this query is a simple RECID/ROWID lookup FIND query.
|
default 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.
|
default 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.
|
boolean |
isIndexedReposition()
Indicate whether this query was optimized using indexed reposition.
|
boolean |
isIterating()
Indicate whether the query is defined inside the scope of FOR EACH block.
|
default 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.
|
default 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.
|
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.
|
boolean |
isPreselect()
Indicate whether this query preselects all of its results.
|
boolean |
isPresort()
Indicate whether the 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.
|
boolean |
last()
Retrieve the last composite row of results for the query.
|
boolean |
last(LockType lockType)
Retrieve the last composite row of results for the query.
|
boolean |
next()
Retrieve the next composite row of results for the query.
|
boolean |
next(LockType lockType)
Retrieve the next composite row of results for the query.
|
default void |
notifyQueryCloseListeners()
Notifies the registered QUERY-CLOSE listeners that the even is about to happen.
|
default void |
notifyQueryOpenListeners(boolean evaluate)
Notifies the registered QUERY-OPEN listeners that the even is about to happen.
|
void |
notifyRepositionListeners(boolean closed,
boolean error,
int targetRepositionRow)
Notify all registered listeners that query is repositioned or closed.
|
void |
open()
Open the prepared query.
|
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).
|
boolean |
previous()
Retrieve the previous composite row of results for the query.
|
boolean |
previous(LockType lockType)
Retrieve the previous composite row of results for the query.
|
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).
|
default 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).
|
void |
releaseBuffers()
Releases the buffers controlled by this query.
|
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.
|
default void |
resetQuery()
Reset the query (this does not close the query).
|
default void |
setBasicLogging(boolean val)
Setter for the BASIC-LOGGING attribute.
|
default void |
setBasicLogging(logical val)
Setter for the BASIC-LOGGING attribute.
|
void |
setBrowsed(boolean browsed)
Indicate to this query that whether it is associated with a browse widget or not.
|
void |
setCache(integer n)
Setter for the CACHE attribute.
|
void |
setCache(long n)
Setter for the CACHE attribute.
|
default void |
setDataRelation(DataRelation relation)
Set the recursive DATA-RELATION the query is to FILL for.
|
default void |
setDynamicPredicate(boolean dynamic)
Set this query in a 'dynamic' mode, to mark the fact that it is originating from a dynamic predicate.
|
void |
setErrorIfNull(boolean errorIfNull)
Set a mode such that setting a null record into a backing 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.
|
default 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). |
void |
setIndexedReposition()
Enable indexed reposition optimization.
|
void |
setIterating(boolean iterating)
Indicate whether the query is defined inside the scope of FOR EACH block.
|
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 query is of presort type.
|
void |
setScrolling()
Enable results list scrolling/repositioning.
|
void |
setSkipDeletedRecord(logical on)
Setter for SKIP-DELETED-RECORD query attribute.
|
void |
setStandalone(boolean standalone)
Change the standalone nature of this query.
|
integer |
size()
Get the current size of the cached results list.
|
default boolean |
unique()
Retrieve a unique record (only valid for a single-table query).
|
default boolean |
unique(LockType lockType)
Retrieve a unique record (only valid for a single-table query),
overriding the default lock type of the underlying query component.
|
addBuffer, addBuffer, addBuffer, addBuffer, bufferHandle, bufferHandle, bufferHandle, bufferHandle, bufferHandle, numBuffers, setBuffers, setBuffers, setBuffersvoid clearResults()
re-open it.default void setDynamicPredicate(boolean dynamic)
dynamic - Flag indicating that this is from a dynamic predicate for a query resource.default boolean isDynamicPredicate()
false.void setScrolling()
boolean isScrolling()
true if this query is scrolling.void setIndexedReposition()
boolean isIndexedReposition()
true if this query is indexed reposition.void open()
void close()
default void close(boolean inResource)
inResource - Flag indicating this query is used in a QUERY legacy resource.default void resetQuery()
int getTableCount()
default RecordBuffer[] getRecordBuffers()
P2JQuery addExternalBuffers(DataModelObject... dmos)
dmos - One or more external buffers.default AbstractJoin getJoin()
null if none.java.util.ArrayList<QueryOffEndListener> getOffEndListeners()
void setErrorIfNull(boolean errorIfNull)
FIRST, LAST, and UNIQUE
records.errorIfNull - If true, setting a null value as the
current record in an underlying buffer will raise an error
condition (if not in silent error mode); if false,
this action will raise an end condition instead.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.lenientOffEnd - true to suppress QueryOffEndException
for next and previous requests;
false to permit these exceptions.void setIterating(boolean iterating)
iterating - true indicating that a query is inside FOR EACH block;
false is defined outside of a FOR EACH.boolean isIterating()
true if the query was defined inside a FOR EACH block.boolean isPresort()
true if the query is of presort type..void setPresort(boolean presort)
presort - true indicating that a query of presort type.
false is not of presort type.void addAccumulator(Accumulator accum)
This implementation assumes the accumulator is not associated with a break group.
accum - Accumulator to be registered with this query.void addAccumulator(Accumulator accum, boolean deferred)
This implementation assumes the accumulator is not associated with a break group.
accum - Accumulator to be registered with this query.deferred - true to defer accumulator recalculation until the
next invocation of Accumulator.accumulate(). If
false, the accumulator recalculates its internal
state as soon as the query's next result is fetched.boolean first()
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
true if query could retrive the first record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.boolean first(LockType lockType)
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
lockType - Lock type to apply to records retrieved (overrides default
lock type set for each query component).true if query could retrive the first record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.boolean last()
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
true if query could retrive the last record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.boolean last(LockType lockType)
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
lockType - Lock type to apply to records retrieved (overrides default
lock type set for each query component).true if query could retrive the last record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.boolean next()
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
true if query could retrive the next record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.boolean next(LockType lockType)
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
lockType - Lock type to apply to records retrieved (overrides default
lock type set for each query component).true if query could retrive the next record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.boolean previous()
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
true if query could retrive the previous record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.boolean previous(LockType lockType)
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
lockType - Lock type to apply to records retrieved (overrides default
lock type set for each query component).true if query could retrive the previous record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query or the fetch of any record fails, or if no records
are available and the query is set to fail in this case.QueryOffEndException - if no records are available and the query is set not to fail
in this case.default boolean unique()
true if query could retrive the unique record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query fails or if more than one result is found which
matches the query criteria.default boolean unique(LockType lockType)
lockType - Lock type which should override that of the query component.true if query could retrive the unique record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the query fails or if more than one result is found which
matches the query criteria.boolean current()
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
true if query could retrive the current record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the reload triggers an error.boolean current(LockType lockType)
If the query involves outer joins, some of the underlying buffers may be empty when this method returns.
lockType - Lock type which should override that of any query component.true if query could retrive the current record succefully;
false if unsuccessful and lenientOffEnd is set on true.ErrorConditionException - if the reload triggers an error.logical hasAny()
Default substitution arguments and a lock type of NONE are
used for this test.
true if the first record exists, else
false.logical hasAny(java.lang.Object[] values)
The specified substitution arguments and a lock type of
NONE are used for this test.
values - Query substitution parameters.true if the first record exists, else
false.logical hasAny(LockType lockType)
Default substitution arguments and the specified lock type are used for this test.
lockType - Lock type for the query. This lock is not actually acquired,
only tested for availability.true if the first record exists, else
false.logical hasAny(java.lang.Object[] values, LockType lockType)
The specified substitution arguments and lock type are used for this test.
values - Query substitution parameters.lockType - Lock type for the query. This lock is not actually acquired,
only tested for availability.true if the first record exists, else
false.logical hasOne()
Default substitution arguments and a lock type of NONE are
used for this test.
true if any record matching the query's criteria
exists, else false.logical hasOne(java.lang.Object[] values)
The specified substitution arguments and a lock type of
NONE are used for this test.
values - Query substitution parameters.true if any record matching the query's criteria
exists, else false.logical hasOne(LockType lockType)
Default substitution arguments and the specified lock type are used for this test.
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.logical hasOne(java.lang.Object[] values, LockType lockType)
The specified substitution arguments and lock type are used for this test.
values - Query substitution parameters.lockType - Lock type for the query. This lock is not actually acquired,
only tested for availability.true if any record matching the query's criteria
exists, else false.default logical isFirstOfGroup(integer level)
level - 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.default logical isFirstOfGroup(int level)
level - 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.default logical isLastOfGroup(integer level)
level - 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.default logical isLastOfGroup(int level)
level - 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.void repositionByID(recid id)
id - A primary key ID, representing the target record (in the case
of a join, this ID is associated with the left-most record in
the join).ErrorConditionException - if the specified ID represents the unknown value.void repositionByID(rowid id1, rowid... joinIDs)
id1 - A primary key ID, representing the target record (in the case
of a join, this ID is associated with the left-most record in
the join).joinIDs - All remaining primary key IDs, if any, arranged from left to
right to coincide with the records being joined by the
underlying query.ErrorConditionException - if any of the specified IDs represents the unknown value.boolean repositionByID(java.lang.Long... joinIDs)
joinIDs - 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.void reposition(NumberType row)
row - 1-based index of the target position.ErrorConditionException - if row represents unknown value.void reposition(int row)
row - 1-based index of the target position.boolean forward(NumberType rows)
rows - Number of rows to scroll the cursor forward.true if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false is returned then it is
possible that cursor's position was moved but not with rows rows.ErrorConditionException - if rows represents the unknown value.boolean forward(int rows)
rows - Number of rows to scroll the cursor forward.true if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false is returned then it is
possible that cursor's position was moved but not with rows rows.boolean backward(NumberType rows)
rows - Number of rows to scroll the cursor backward.true if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false is returned then it is
possible that cursor's position was moved but not with rows rows.ErrorConditionException - if rows represents the unknown value.boolean backward(int rows)
rows - Number of rows to scroll the cursor backward.true if operation was successful and the cursor was moved the exact amount
of rows as specified by the parameter. If false is returned then it is
possible that cursor's position was moved but not with rows rows.integer size()
integer currentRow()
integer currentRowImpl()
logical isOffEnd()
true,
this indicates that the query cannot produce any more results in the
current scroll direction.true if the cursor is off either end of its query's results list.boolean _isOffEnd()
true,
this indicates that the query cannot produce any more results in the
current scroll direction.true if the cursor is off either end of its query's results list.OffEnd getOffEnd()
OffEnd constants NONE,
FRONT, or BACK.boolean isPreselect()
true if the query preselects its results;
false if the query's results are dynamically
navigated.default boolean isFindByRowid()
true if this is a RECID/ROWID lookup FIND query, else false. This default
implementation returns false.boolean isNativelyPreselect()
true.boolean isFetchOnReposition()
true if set to fetch after reposition, else false.void setFetchOnReposition(boolean enable)
enable - true to enable automatic fetching;
false to disable.void addRepositionListener(RepositionListener listener)
listener - Reposition listener to be registered.void removeRepositionListener(RepositionListener listener)
listener - Reposition listener to be unregistered.void notifyRepositionListeners(boolean closed,
boolean error,
int targetRepositionRow)
closed - A true value will inform all listeners that the query was explicitly closed.error - true if an error happened during reposition.targetRepositionRow - Row used as the target for reposition. If it was deleted, reposition with fetching
may end up on a different row.void setBrowsed(boolean browsed)
browsed - true to indicate the query has an associated
browse widget, else false.boolean isBrowsed()
true if the query has an associated browse widget,boolean isStandalone()
true if standalone, else false.void setStandalone(boolean standalone)
standalone - true to set query as standalone;
false to set query as contained.void cleanup()
logical queryClose()
true if QUERY-CLOSE() succeeds, else false.logical queryBackward(int rows)
true if REPOSITION-BACKWARD() succeeds, else false.logical queryBackward(NumberType rows)
true if REPOSITION-BACKWARD() succeeds,
else false.logical queryForward(int rows)
true if REPOSITION-FORWARD() succeeds,
else false.logical queryForward(NumberType rows)
true if REPOSITION-FORWARD() succeeds,
else false.logical queryReposition(int n)
n - An integer expression representing the sequence number.true if REPOSITION-TO-ROW() succeeds,
else false.logical queryReposition(NumberType n)
n - An integer expression representing the sequence number.true if REPOSITION-TO-ROW() succeeds,
else false.logical queryRepositionByID(rowid id1, rowid... joinIDs)
id1 - A primary key ID, representing the target record (in the case
of a join, this ID is associated with the left-most record in
the join).joinIDs - All remaining primary key IDs, if any, arranged from left to
right to coincide with the records being joined by the
underlying query.true if REPOSITION-TO-ROWID() succeeds,
else false.default logical queryRepositionByID(character rowId)
rowId - A character representation of this rowid.true if REPOSITION-TO-ROWID() succeeds,
else false.integer getNumResults()
logical prepare(java.lang.String predicate)
QUERY-PREPARE() method from 4GL.predicate - The predicate to be prepared by this query.logical prepare(character predicate)
QUERY-PREPARE() method from 4GL.predicate - The predicate to be prepared by this query.logical queryOpen()
QUERY-OPEN() method from 4GL.
Note: You must perform prepare() on a query
object before you perform queryOpen on it.character indexInformation()
indexInformation in interface IndexInformationcharacter indexInformation(int n)
indexInformation in interface IndexInformationn - An integer expression that evaluates to the level of join for which you want
index information.character indexInformation(NumberType n)
indexInformation in interface IndexInformationn - An integer expression that evaluates to the level of join for which you want index
information.logical forwardOnly()
void changeForwardOnly(logical forwardOnly)
forwardOnly - New value of FORWARD-ONLY attribute.void changeForwardOnly(boolean forwardOnly)
forwardOnly - New value of FORWARD-ONLY attribute.character prepareString()
integer getCache()
void setCache(integer n)
n - The cache value.void setCache(long n)
n - The cache value.default logical getNext()
true if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).boolean _getNext()
true if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false.logical getNext(LockType lockType)
lockType - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).logical getNext(long lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getNext(NumberType lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getNext(long lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getNext(long lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getNext(NumberType lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getNext(NumberType lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the next record in the query is found. If the query is not
open or the next record cannot be found (query is empty or the query result list
pointer is on the last row), the method returns false. If the query
object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getPrevious()
true if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).logical getPrevious(long lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getPrevious(LockType lockType)
lockType - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getPrevious(NumberType lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getPrevious(long lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getPrevious(NumberType lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getPrevious(long lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getPrevious(NumberType lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the previous record in the query is found. If the query is
not open or the previous record cannot be found (query is empty or the query
result list pointer is on the first row), the method returns false.
If the query object handle is invalid, the method returns the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getFirst()
true 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 (?).logical getFirst(long lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getFirst(NumberType lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getFirst(LockType lockType)
lockType - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getFirst(long lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getFirst(NumberType lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getFirst(long lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getFirst(NumberType lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the first record in the query is found. If the query is not
open or the first record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getLast()
true 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 (?).logical getLast(long lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getLast(NumberType lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getLast(LockType lockType)
lockType - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock has not valid internal value.logical getLast(long lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getLast(NumberType lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getLast(long lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getLast(NumberType lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if the last record in the query is found. If the query is not
open or the last record cannot be found (query is empty), the method returns
false. If the query object handle is invalid, the method returns
the Unknown value (?).java.lang.IllegalArgumentException - if lock or nowait have not valid internal values.logical getCurrent()
true if GET-CURRENT() succeeds, else false.logical getCurrent(long lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if GET-CURRENT() succeeds, else false.logical getCurrent(NumberType lock)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKtrue if GET-CURRENT() succeeds, else false.logical getCurrent(LockType lockType)
lockType - Lock typetrue if GET-CURRENT() succeeds, else false.logical getCurrent(long lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.logical getCurrent(NumberType lock, long nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.logical getCurrent(long lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.logical getCurrent(NumberType lock, NumberType nowait)
lock - SHARE-LOCK|EXCLUSIVE-LOCK|NO-LOCKnowait - NO-WAITtrue if GET-CURRENT() succeeds, else false.void setSkipDeletedRecord(logical on)
on - New value for the attribute.logical isSkipDeletedRecord()
void include(DataModelObject dmo, java.lang.String... fields)
dmo - DMO proxy which defines the buffer for which the fields are specified.fields - The fields included in a record retrieval. If no fields are specified, only record
identifiers are retrieved. No subscripts can be specified for extent fields.void exclude(DataModelObject dmo, java.lang.String... fields)
dmo - DMO proxy which defines the buffer for which the fields are specified.fields - The fields excluded from a record retrieval. If no fields are specified, complete
records are retrieved. No subscripts can be specified for extent fields.logical deleteResultListEntry()
true on success.logical deleteResultListEntry(boolean allowBetweenRows)
allowBetweenRows - If true then the cursor can be positioned between rows (the next
row will be deleted). false for conventional DELETE-RESULT-LIST-ENTRY()
mode where the cursor should be positioned on a row (otherwise false is
returned).true on success.logical createResultListEntry()
true on success.void setParameterFilter(ParameterFilter parameterFilter)
parameterFilter - The filter that handles passed parameters.void releaseBuffers()
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.
fr - 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.void clearDynamicFilters()
default void hintFullResults()
default void addQueryEventListener(P2JQuery.QueryEventListener qel)
Note that this method is only called for dynamic queries only (for the moment).
qel - The listener to be notified.default void notifyQueryOpenListeners(boolean evaluate)
evaluate - Flag indicating that the dynamic query must evaluate its dynamic calls (like DYNAMIC-FUNCTION)
in the WHERE clause.default void notifyQueryCloseListeners()
default logical getBasicLogging()
default void setBasicLogging(logical val)
val - Flag activating or deactivating the logging.default void setBasicLogging(boolean val)
val - Flag activating or deactivating the logging.default void setFillingBrowseRows(boolean on)
true). That is, temporarily overwrite the
SKIP-DELETED-RECORDS until the flag is turned off.
The default implementation does nothing.
on - if true the deleted rows will not be returned because the query is managed by the
browse widget.default boolean isFillingBrowseRows()
true during the returning of rows for populating a browse widget.setFillingBrowseRows(boolean)default DataRelation getDataRelation()
default void setDataRelation(DataRelation relation)
relation - the recursive DATA-RELATION the query is to FILL for