|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface DBClassStore<T extends Resource>
provides persistence service for a Resource in the context of a Database. Note that all operations on a DBClassStore instance require to hold the lock on the active transaction of its Database, otherwise a TransactionException is thrown.
Database,
DBTransaction,
TransactionException,
Resource| Method Summary | |
|---|---|
boolean |
contains(T entry)
determines whether the given entry is present in the database; it may be, however, that the database object differs from the given object (but its IDs must be the same) if present. |
void |
delete(T entry)
removes the given entry from the database |
Enumeration<T> |
fetch(Filter<T> filter)
filter may be null, in which case all entries from are returned. |
Object |
generateNewID()
not every call must necessarily return a new value, but it must return an ID not yet present in the persistent storage. |
Database<?> |
getDatabase()
provides access to the database instance that also coordinates the transaction management. |
T |
getResource(Object id)
returns a Resource based on its ID. |
void |
insert(T entry)
it is suggested to create the entry with an ID obtained through generateNewID() before passing it into
this method. |
int |
size()
returns the total number of T elements in this store |
void |
update(T entry)
updates the given entry in the database. |
| Method Detail |
|---|
Database<?> getDatabase()
boolean contains(T entry)
throws DatabaseException
DatabaseException
void delete(T entry)
throws DatabaseException
DatabaseException
Object generateNewID()
throws DatabaseException
DatabaseException
void insert(T entry)
throws DatabaseException
generateNewID() before passing it into
this method.
DatabaseExceptiongenerateNewID()
void update(T entry)
throws DatabaseException
DatabaseException
Enumeration<T> fetch(Filter<T> filter)
throws DatabaseException
DatabaseExceptionAbstractIterator.list(Enumeration),
IterationException
T getResource(Object id)
throws DatabaseException
id - the ID that is retrieved from Resource.getID()
DatabaseExceptionResource.getID()
int size()
throws DatabaseException
DatabaseException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||