|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.sf.borg.model.db.jdbc.JdbcDB
net.sf.borg.model.db.jdbc.JdbcBeanDB<T>
abstract class JdbcBeanDB<T extends KeyedEntity<T>>
abstract base class for all classes that manage reading/writing of KeyedEntities to and from a JDBC database. also provides an object cache.
| Field Summary |
|---|
| Fields inherited from class net.sf.borg.model.db.jdbc.JdbcDB |
|---|
connection_ |
| Constructor Summary | |
|---|---|
JdbcBeanDB()
Creates a new instance of JdbcDB. |
|
| Method Summary | |
|---|---|
(package private) abstract T |
createFrom(ResultSet rs)
Fills in an entity from a result set |
protected void |
delCache(int key)
|
protected void |
emptyCache()
|
(package private) abstract PreparedStatement |
getPSAll()
|
(package private) abstract PreparedStatement |
getPSOne(int key)
|
Collection<T> |
readAll()
Read all Entities. |
protected T |
readCache(int key)
|
T |
readObj(int key)
Read a single KeyedEntity from the database by key |
void |
sync()
flush the cache |
protected void |
writeCache(T bean)
|
| Methods inherited from class net.sf.borg.model.db.jdbc.JdbcDB |
|---|
beginTransaction, buildDbDir, close, commitTransaction, connect, execSQL, getConnection, getOption, getOptions, getUrl, rollbackTransaction, setOption, toInt, toInt, toStr, toVect |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
JdbcBeanDB()
| Method Detail |
|---|
public void sync()
protected void writeCache(T bean)
protected void emptyCache()
protected void delCache(int key)
protected T readCache(int key)
public Collection<T> readAll()
throws Exception
Exception
public T readObj(int key)
throws Exception
key - the key
Exception - the exception
abstract PreparedStatement getPSOne(int key)
throws SQLException
SQLException
abstract PreparedStatement getPSAll()
throws SQLException
SQLException
abstract T createFrom(ResultSet rs)
throws SQLException
rs - the result set
SQLException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||