R
- type of source row classpublic class SimpleLazySelector<R> extends AbstractLazySelector<R>
Database
that was used to select source row.
SimpleLazySelector is good for scenario's when source row is maintained in memory and database/connection used to select the source row remains open. Scenario's like this occur in stand-alone applications and web applications where source is never stored in web session.
Constructor and Description |
---|
SimpleLazySelector()
Constructs for use when SimpleLazySelector is base class of row that will contain lazy select fields.
|
SimpleLazySelector(R source)
Constructs for use as delegate for row that will contain lazy select fields.
|
Modifier and Type | Method and Description |
---|---|
protected void |
closeDatabase()
Does nothing since
Database from pendingLazySelects(Database)
is reused. |
protected void |
openDatabase()
Does nothing since
Database from pendingLazySelects(Database)
is reused. |
void |
pendingLazySelects(Database database)
Saves reference to database for use in future lazy selects.
|
begin, checkLazySelects, commit, getDatabase, getPendingLazySelectFields, getSource, initPendingLazySelectCascadeFields, isLocalTransaction, isPendingLazySelects, isUseTransaction, lazySelect, rollback, setDatabase, setUseTransaction
public SimpleLazySelector()
AbstractLazySelector.setUseTransaction(boolean)
is true by default.public SimpleLazySelector(R source)
AbstractLazySelector.setUseTransaction(boolean)
is true by default.source
- row that contains fields with SelectCascade.lazy()
is true; typically source
is the one side of a one-to-many relationship or source has a reference to the other class in a
one-to-one relationshippublic void pendingLazySelects(Database database) throws LazyCascadeException
pendingLazySelects
in interface LazySelectable
pendingLazySelects
in class AbstractLazySelector<R>
database
- perform lazy selects from this databaseLazyCascadeException
- if errorprotected void openDatabase() throws LazyCascadeException
Database
from pendingLazySelects(Database)
is reused.openDatabase
in class AbstractLazySelector<R>
LazyCascadeException
- if errorprotected void closeDatabase() throws LazyCascadeException
Database
from pendingLazySelects(Database)
is reused.closeDatabase
in class AbstractLazySelector<R>
LazyCascadeException
- if error