|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Persistence
Provides Object-Relational DB mapping.
| Method Summary | |
|---|---|
int |
count(String table,
String where)
An utility method for checking the number of matching rows. |
void |
delete(Persistent object)
Removes an object from the database. |
void |
delete(String where,
PersistentFactory factory)
Removes the objects from the database. |
boolean |
exists(String table,
String where)
An utility method for checking for existence of rows. |
Database |
getDatabase()
Get the database component used by persistence. |
Persistent |
load(long id,
PersistentFactory factory)
Loads an object from the database. |
List |
load(String where,
PersistentFactory factory)
Loads objects from the database. |
void |
revert(Persistent object)
Reverts the object to the saved state. |
void |
save(Persistent object)
Saves an object in the database. |
| Method Detail |
|---|
Persistent load(long id,
PersistentFactory factory)
throws PersistenceException
id - the identifier of the object.factory - the object instance factory.
PersistenceException - if any exception occured.
List load(String where,
PersistentFactory factory)
throws PersistenceException
Note that joins are not supported. This package provides a means of converting objects to rows in a table and vice versa. If you want more, you need some different tool.
where - the where clause to be used in the queryfactory - the object instance factory.
PersistenceException - if any exception occured.
void save(Persistent object)
throws PersistenceException
object - the object to be saved.
PersistenceException - if any exception occured.
void revert(Persistent object)
throws PersistenceException,
IllegalStateException
object - the object to have it's state restored.
PersistenceException - if any exception occured.
IllegalStateException - if no state has been saved yet for the
object in question.
void delete(Persistent object)
throws PersistenceException
object - the object to be removed.
PersistenceException - if any exception occured.
void delete(String where,
PersistentFactory factory)
throws PersistenceException
where - the where clause to be used in the queryfactory - the object instance factory.
PersistenceException - if any exception occured.
boolean exists(String table,
String where)
throws PersistenceException
table - the table to be checked.where - the condition.
true if the condition is true for one
or more rows in the table.
PersistenceException - if any exception occured.
int count(String table,
String where)
throws PersistenceException
table - the table to be chcked.where - the condition.
table matching the condition.
PersistenceException - if any exception occured.Database getDatabase()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||