T - the retrieved typepublic class ResultSetCursor<T extends PersistentDomainObject<T>> extends Object implements ScrollableResource<T>
ResultSetWrapper.| Modifier and Type | Class and Description |
|---|---|
static class |
ResultSetCursor.FetchList<T>
Adds a closed flag to saveObject a roundtrip in remote sessions.
|
| Constructor and Description |
|---|
ResultSetCursor(DomainContext context,
RemoteResultSetCursor<T> remoteCursor)
Creates a cursor for a remote session.
Constructor for pdo objects. |
ResultSetCursor(T pdo,
ResultSetWrapper rs)
Creates a cursor for a local session.
|
ResultSetCursor(T pdo,
ResultSetWrapper rs,
JoinedSelect<T> js)
Creates a cursor for a local session.
|
| Modifier and Type | Method and Description |
|---|---|
void |
afterLast()
Positions the cursor after the last row.
Works even for empty cursors. |
protected void |
assertNoJoins()
Asserts that there are no joins in the query.
|
protected void |
assertSessionIsLocal()
Asserts that session is local.
|
protected void |
assertSessionIsRemote()
Asserts that session is remote.
|
void |
beforeFirst()
Positions the cursor before the first row.
Works even for empty cursors. |
void |
close()
Closes the cursor.
The cursor is opened in its constructor. |
protected void |
configureRemoteObject(T pdo)
Configures the remotely retrieved PDO.
|
ResultSetCursor.FetchList<T> |
fetch()
Fetches the next objects up to the fetchsize.
This method is provided to minimize the number of roundtrips especially for remote cursors. |
protected void |
finalize() |
boolean |
first()
Rewinds the cursor to the first row.
|
T |
get()
Gets the data object of the current row.
|
DomainContext |
getDomainContext()
Gets the domain context.
|
int |
getFetchDirection()
Gets the fetch direction.
|
int |
getFetchSize()
Gets the fetchsize.
|
JoinedSelect<T> |
getJoinedSelect()
Gets the join configuration.
|
RemoteResultSetCursor<T> |
getRemoteCursor()
Gets the remote cursor.
|
ResultSetWrapper |
getResultSet()
Gets the result set.
|
int |
getRow()
Gets the current row.
Row numbers start at 1. |
Session |
getSession()
Gets the session.
|
boolean |
isAfterLast()
Checks whether the cursor is after the last row.
|
boolean |
isBeforeFirst()
Checks whether the cursor is before the first row.
|
boolean |
isClosed()
Returns whether the cursor is closed.
|
boolean |
last()
Positions the cursor on the last row.
|
boolean |
next()
Moves the cursor to the next row.
If there are no more rows the current row remains unchanged. |
boolean |
previous()
Moves the cursor to the previous row.
If we are already at the beginning, the cursor remains unchanged. |
boolean |
scroll(int rows)
Moves the cursor a given number of rows.
|
void |
setFetchDirection(int direction)
Sets the fetch direction.
|
void |
setFetchSize(int rows)
Sets the fetchsize.
This is the number of rows the cursor will fetch from the server in one batch. |
boolean |
setRow(int row)
Sets the cursor to a given row.
Row numbers start at 1. |
List<T> |
toList()
Returns the objects of this cursor as a list.
|
protected void |
toList(List<T> list)
Adds the rest of the cursor to a list.
|
List<T> |
toListAndClose()
Returns the objects of this cursor as a list and closes this cursor.
|
public ResultSetCursor(T pdo, ResultSetWrapper rs, JoinedSelect<T> js)
pdo - the PDO proxyrs - the result setjs - the join configuration, null if no joinspublic ResultSetCursor(T pdo, ResultSetWrapper rs)
pdo - the PDO proxyrs - the result setpublic ResultSetCursor(DomainContext context, RemoteResultSetCursor<T> remoteCursor)
context - the domain contextremoteCursor - the remote cursorpublic ResultSetWrapper getResultSet()
public JoinedSelect<T> getJoinedSelect()
PersistenceException - if session is remotepublic RemoteResultSetCursor<T> getRemoteCursor()
PersistenceException - if session is localpublic Session getSession()
public DomainContext getDomainContext()
public void close()
close in interface AutoCloseableclose in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean isClosed()
isClosed in interface ScrollableResource<T extends PersistentDomainObject<T>>public int getRow()
getRow in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean setRow(int row)
setRow in interface ScrollableResource<T extends PersistentDomainObject<T>>row - the row number (must be ≥ 0)public boolean first()
first in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean last()
last in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean next()
next in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean previous()
previous in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean scroll(int rows)
scroll in interface ScrollableResource<T extends PersistentDomainObject<T>>rows - the number of rows to move, negative to move backwardspublic void beforeFirst()
beforeFirst in interface ScrollableResource<T extends PersistentDomainObject<T>>public void afterLast()
afterLast in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean isBeforeFirst()
isBeforeFirst in interface ScrollableResource<T extends PersistentDomainObject<T>>public boolean isAfterLast()
isAfterLast in interface ScrollableResource<T extends PersistentDomainObject<T>>public T get()
get in interface ScrollableResource<T extends PersistentDomainObject<T>>public List<T> toList()
toList in interface ScrollableResource<T extends PersistentDomainObject<T>>public List<T> toListAndClose()
toListAndClose in interface ScrollableResource<T extends PersistentDomainObject<T>>public void setFetchSize(int rows)
setFetchSize in interface ScrollableResource<T extends PersistentDomainObject<T>>rows - the fetchsizepublic int getFetchSize()
getFetchSize in interface ScrollableResource<T extends PersistentDomainObject<T>>public void setFetchDirection(int direction)
direction - the direction, see ResultSet.setFetchDirection(int).public int getFetchDirection()
public ResultSetCursor.FetchList<T> fetch()
fetch in interface ScrollableResource<T extends PersistentDomainObject<T>>protected void finalize()
throws Throwable
protected void toList(List<T> list)
list - the listprotected void configureRemoteObject(T pdo)
pdo - the PDOprotected void assertSessionIsRemote()
protected void assertSessionIsLocal()
protected void assertNoJoins()
Copyright © 2016 Krake Softwaretechnik. All rights reserved.