public class CastorPersistenceQueryResults
extends java.lang.Object
implements de.ipcon.db.core.QueryResultsI
This class acts as a bridge between the native PersistenceHandlerI (Castor) and the
high-level QueryResultsI interface. It supports both legacy SQL calls and modern,
compiled OQL queries.
Key Features:
Predicate filtering during iteration,
minimizing the number of Business Objects (BOs) that reach the application layer.
prefetchPaths to avoid N+1 select
issues in lazy-loading scenarios.
Throughput Optimizations (Java 8):
OQLQuery,
QueryResults| Constructor and Description |
|---|
CastorPersistenceQueryResults(CastorPersistenceHandler _ph,
java.lang.String _query,
java.lang.Object[] _parms,
short _mode,
java.lang.String[] _prefetchPaths)
Initializes the result set and triggers the query lifecycle.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cancel()
Attempts to cancel the currently running database query,
if supported by the underlying driver and Castor implementation
|
void |
close()
Closes the underlying result set and the query implementation.
|
java.lang.String |
currentTag() |
boolean |
hasNext()
Determines if a subsequent record is available, respecting any
filterPredicate applied during OQL compilation. |
boolean |
isClosed() |
java.lang.Object |
next()
Throughput Optimization:
Memory Management:
For read-only transactions, the previous BO is aggressively slimmed before fetching
the next to prevent Heap bloat.
|
void |
remove()
Modification via iterator is not supported in Castor OQL results.
|
public CastorPersistenceQueryResults(CastorPersistenceHandler _ph, java.lang.String _query, java.lang.Object[] _parms, short _mode, java.lang.String[] _prefetchPaths)
_ph - The active CastorPersistenceHandler. Must not be finished or closed._query - The query string. If prefixed with "CALL SQL", it bypasses the OQL parser._parms - Input parameters. Null-safe; converted to empty array if null._mode - Persistence lock mode. Determines the isolation level of the fetched objects
(e.g. READ_ONLY, SHARED, EXCLUSIVE)._prefetchPaths - Attribute paths to be eagerly loaded.java.lang.IllegalStateException - If the provided PersistenceHandler is already in a 'finished' state.PersistenceException - If OQL compilation or SQL execution fails.public void close()
Closes the underlying result set and the query implementation.
In addition to resource cleanup, this method "slims" any currently held
Business Objects to aid memory reclamation and notifies the handler of
query performance metrics via ph.complainSlowQuery.
close in interface de.ipcon.db.core.QueryResultsIclose in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic boolean isClosed()
isClosed in interface de.ipcon.db.core.QueryResultsIpublic boolean hasNext()
Determines if a subsequent record is available, respecting any
filterPredicate applied during OQL compilation.
Optimization Logic:
nextFittingBO.
hasNext in interface java.util.Iteratortrue if a subsequent call to next() is guaranteed to return a BO.LockNotGrantedException - if a database lock prevents row access.PersistenceException - if an error occurs during ResultSet navigation.public java.lang.Object next()
Throughput Optimization:
hasNext().
next in interface java.util.Iteratorpublic void remove()
remove in interface java.util.Iteratorjava.lang.UnsupportedOperationException - always.public java.lang.String currentTag()
currentTag in interface de.ipcon.db.core.QueryResultsIpublic void cancel()
cancel in interface de.ipcon.db.core.QueryResultsICopyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.