interface Joinable extends Scrollable
CompoundQuery
must implement this interface. It defines methods which will be called by
the enclosing, compound query object, which retrieve records and update
the state of the implementing query and its buffer(s).P2JQuery.Parameter
Modifier and Type | Method and Description |
---|---|
void |
forceDynamicOperation()
Force this query to operate in dynamic retrieval mode, if it supports this mode.
|
java.lang.Object[] |
getArgs()
Get the query substitution arguments associated with this query, if any.
|
AbstractJoin |
getJoin()
Get the legacy natural join, if any, associated with this query.
|
java.lang.String |
getOriginalWhere()
Get the original, HQL where clause associated with this query.
|
RecordBuffer[] |
getRecordBuffers()
Get an array of all record buffers managed by this query.
|
RecordBuffer[] |
getReferencedBuffers()
Get an array of all record buffers referenced by this query, including those directly
involved in the query, as well as those (if any) indirectly referenced by inlined,
converted, CAN-FIND expressions.
|
java.lang.Object[] |
getRow()
Assemble an array of primary key IDs or DMOs for the current record(s)
in the buffers underlying this query, from left-most to right-most (in
the sense of how the query joins the associated tables).
|
java.lang.String |
getSortPhrase()
Get the sort phrase associated with this query.
|
boolean |
hasWhereExpression()
Indicate whether this query has a client-side where clause expression associated with it.
|
void |
load(java.lang.Object[] data,
LockType lockType,
boolean silentIfNullId)
Load one or more records into their associated buffers, given an array
of primary key ID values, or the actual DMOs themselves.
|
AdaptiveComponent |
makeAdaptiveServerJoinComponent(java.util.List<AdaptiveComponent> joinList,
AdaptiveQuery query,
int iteration,
boolean outer,
CompoundComponent fallback)
Create an adaptive query component based on the information in this query (which is
presumed to be a single-table query), and given a list of adaptive query components which
represent outer, nested query loops, which will perform a server-side join to the
innermost, nested query component.
|
QueryComponent |
makePreselectServerJoinComponent(java.util.List<QueryComponent> joinList,
int iteration,
boolean outer)
Create a preselect query component based on the information in this query (which is
presumed to be a single-table query), and given a list of preselect query components which
represent outer, nested query loops, which will perform a server-side join to the
innermost, nested query component.
|
java.lang.Object[] |
peekFirst()
Fetch the array of primary key IDs associated with the first result in
this query's result list.
|
java.lang.Object[] |
peekLast()
Fetch the array of primary key IDs associated with the last result in
this query's result list.
|
void |
registerRecordChangeListeners(int scope)
Register all
RecordChangeListener s associated with this
query (if any), with the context-local ChangeBroker at the
indicated scope. |
void |
reset(boolean resolveArgs)
Reset the query by clearing its state to a known default.
|
void |
setErrorIfNull(boolean errorIfNull)
Set a mode on the underlying buffer(s) such that setting a null record
into a buffer may or may not result in an error condition.
|
void |
setFullRecords()
Force the query to retrieve full records, rather than primary keys only.
|
void |
setResults(Results results)
Set the given results object into this query.
|
void |
setUnknownRecord()
Set each buffer backing the query to unknown mode.
|
peekNext, peekPrevious
_isOffEnd, addAccumulator, addAccumulator, addBuffer, addBuffer, addRepositionListener, backward, backward, bufferHandle, bufferHandle, bufferHandle, bufferHandle, bufferHandle, changeForwardOnly, changeForwardOnly, cleanup, close, close, current, current, currentRow, currentRowImpl, deleteResultListEntry, deleteResultListEntry, exclude, first, first, forward, forward, forwardOnly, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getCurrent, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getFirst, getLast, getLast, getLast, getLast, getLast, getLast, getLast, getLast, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNext, getNumResults, getOffEnd, getOffEndListeners, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getPrevious, getTableCount, hasAny, hasAny, hasAny, hasAny, hasOne, hasOne, hasOne, hasOne, include, indexInformation, indexInformation, indexInformation, isBrowsed, isFetchOnReposition, isNativelyPreselect, isOffEnd, isOpen, isPreselect, isScrolling, isSkipDeletedRecord, isStandalone, last, last, next, next, notifyRepositionListeners, numBuffers, open, optimize, prepare, prepare, prepareString, previous, previous, queryBackward, queryBackward, queryClose, queryForward, queryForward, queryOpen, queryReposition, queryReposition, queryRepositionByID, removeRepositionListener, reposition, reposition, repositionByID, repositionByID, setBrowsed, setBuffers, setBuffers, setExternalBuffers, setFetchOnReposition, setParameterFilter, setScrolling, setSkipDeletedRecord, setStandalone, size, unique, unique
void setErrorIfNull(boolean errorIfNull)
FIRST
, LAST
, and UNIQUE
iteration types.setErrorIfNull
in interface P2JQuery
errorIfNull
- If true
, setting a null
value as the
current record in an underlying buffer will raise an error
condition (if not in silent error mode); if false
,
this action will raise an end condition instead.void setFullRecords()
void setUnknownRecord()
RecordBuffer.setUnknownMode()
void reset(boolean resolveArgs)
resolveArgs
- true
if query substitution arguments should be
resolved as part of the reset; false
if existing
argument values should be used for the next query execution.RecordBuffer[] getRecordBuffers()
RecordBuffer[] getReferencedBuffers()
void load(java.lang.Object[] data, LockType lockType, boolean silentIfNullId) throws MissingRecordException, PersistenceException
The contract of this method is that if an implementor cannot load the
expected value (e.g., the record has been deleted or is otherwise no
longer available), it must throw MissingRecordException
, after
setting the associated buffer into unknown mode
. Note that a record being locked by another session does
not constitute a "missing" record. Note also that this exception must
not be thrown until all the elements of data
have been
processed to the extent possible.
data
- Array of primary key IDs or DMOs, one per table involved in the
query.lockType
- Lock type which should override that of the query. Set to
null
to allow query to use its current lock type.silentIfNullId
- If true
, do not raise MissingRecordException
if some of the provided IDs are null
. null
IDs are valid for queries with OUTER join.MissingRecordException
- if any record cannot be loaded, because it is no longer
available (e.g., deleted, etc.).PersistenceException
- if there is an error loading data.getRow()
void setResults(Results results)
results
- New result set for this query.java.lang.Object[] getRow()
load(Object[], LockType, boolean)
java.lang.Object[] peekFirst()
null
if there is no such result.java.lang.Object[] peekLast()
null
if there is no such result.void registerRecordChangeListeners(int scope)
RecordChangeListener
s associated with this
query (if any), with the context-local ChangeBroker
at the
indicated scope.scope
- Scope at which listeners should be registered with the change
broker.AdaptiveComponent makeAdaptiveServerJoinComponent(java.util.List<AdaptiveComponent> joinList, AdaptiveQuery query, int iteration, boolean outer, CompoundComponent fallback)
joinList
- List of adaptive components representing nested query loops which will contain
the adaptive query component returned by this method. The last component in the
list represents the nested query loop immediately containing the returned query
component, with which the join will be made.query
- Adaptive query which will manage the server-side join of joinList
and
the returned query component.iteration
- Iteration type: FIRST, LAST, or NEXT.outer
- true
if the join should be a left outer join. This type of join is
not supported at the time of this writing, so this parameter should always be
false
. It is here to support a planned, future enhancement.fallback
- A compound query component to use in the event the multi-table adaptive query
switches from preselect to dynamic retrieval mode.QueryComponent makePreselectServerJoinComponent(java.util.List<QueryComponent> joinList, int iteration, boolean outer)
joinList
- List of preselect components representing nested query loops which will contain
the preselect query component returned by this method. The last component in the
list represents the nested query loop immediately containing the returned query
component, with which the join will be made.iteration
- Iteration type: FIRST, LAST, or NEXT.outer
- true
if the join should be a left outer join. This type of join is
not supported at the time of this writing, so this parameter should always be
false
. It is here to support a planned, future enhancement.boolean hasWhereExpression()
true
if there is a where expression; else false
.java.lang.Object[] getArgs()
null
if there are none.java.lang.String getOriginalWhere()
null
if there is none.AbstractJoin getJoin()
null
if none.void forceDynamicOperation()
java.lang.String getSortPhrase()