|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface EntityDB<T extends KeyedEntity<T>>
Interface for a class that provides basic ORM mapping for a KeyedEntity
Method Summary | |
---|---|
void |
addObj(T entity)
Adds a KeyedEntity to the database |
void |
delete(int key)
Delete a KeyedEntity from the database |
T |
newObj()
Return a new instance of the KeyedEntity |
int |
nextkey()
get the next available key value for this entity type |
Collection<T> |
readAll()
Read all KeyedEntities of a particular type from the database. |
T |
readObj(int key)
Read a single KeyedEntity from the database by key |
void |
sync()
Sync with the database (likely to just be a cache flush) |
void |
updateObj(T entity)
Update a KeyedEntity in the database |
Method Detail |
---|
Collection<T> readAll() throws Exception
Exception
T readObj(int key) throws Exception
key
- the key
Exception
T newObj()
void addObj(T entity) throws Exception
entity
- the KeyedEntity
Exception
void updateObj(T entity) throws Exception
entity
- the KeyedEntity
Exception
void delete(int key) throws Exception
key
- the key of the entity
Exception
int nextkey() throws Exception
Exception
void sync()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |