net.sf.borg.model.db.jdbc
Class AddrJdbcDB

java.lang.Object
  extended by net.sf.borg.model.db.jdbc.JdbcDB
      extended by net.sf.borg.model.db.jdbc.JdbcBeanDB<Address>
          extended by net.sf.borg.model.db.jdbc.AddrJdbcDB
All Implemented Interfaces:
EntityDB<Address>

public class AddrJdbcDB
extends JdbcBeanDB<Address>
implements EntityDB<Address>

this is the JDBC layer for access to the addresses table.


Field Summary
 
Fields inherited from class net.sf.borg.model.db.jdbc.JdbcDB
connection_
 
Constructor Summary
AddrJdbcDB()
           
 
Method Summary
 void addObj(Address addr)
          Adds a KeyedEntity to the database
(package private)  Address createFrom(ResultSet r)
          Fills in an entity from a result set
 void delete(int key)
          Delete a KeyedEntity from the database
 Collection<Integer> getKeys()
          Gets the keys.
(package private)  PreparedStatement getPSAll()
           
(package private)  PreparedStatement getPSOne(int key)
           
 Address newObj()
          Return a new instance of the KeyedEntity
 int nextkey()
          get the next available key value for this entity type
 void updateObj(Address addr)
          Update a KeyedEntity in the database
 
Methods inherited from class net.sf.borg.model.db.jdbc.JdbcBeanDB
delCache, emptyCache, readAll, readCache, readObj, sync, writeCache
 
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
 
Methods inherited from interface net.sf.borg.model.db.EntityDB
readAll, readObj, sync
 

Constructor Detail

AddrJdbcDB

public AddrJdbcDB()
Method Detail

addObj

public void addObj(Address addr)
            throws Exception
Description copied from interface: EntityDB
Adds a KeyedEntity to the database

Specified by:
addObj in interface EntityDB<Address>
Parameters:
addr - the KeyedEntity
Throws:
Exception

delete

public void delete(int key)
            throws Exception
Description copied from interface: EntityDB
Delete a KeyedEntity from the database

Specified by:
delete in interface EntityDB<Address>
Parameters:
key - the key of the entity
Throws:
Exception

getKeys

public Collection<Integer> getKeys()
                            throws Exception
Gets the keys.

Returns:
the keys
Throws:
Exception - the exception

nextkey

public int nextkey()
            throws Exception
Description copied from interface: EntityDB
get the next available key value for this entity type

Specified by:
nextkey in interface EntityDB<Address>
Returns:
the next available key
Throws:
Exception

newObj

public Address newObj()
Description copied from interface: EntityDB
Return a new instance of the KeyedEntity

Specified by:
newObj in interface EntityDB<Address>
Returns:
the new KeyedEntity

getPSOne

PreparedStatement getPSOne(int key)
                     throws SQLException
Specified by:
getPSOne in class JdbcBeanDB<Address>
Returns:
a PreparedStatement that reads one entity by key
Throws:
SQLException

getPSAll

PreparedStatement getPSAll()
                     throws SQLException
Specified by:
getPSAll in class JdbcBeanDB<Address>
Returns:
a PreparedStatement that reads all entities from a table
Throws:
SQLException

createFrom

Address createFrom(ResultSet r)
             throws SQLException
Description copied from class: JdbcBeanDB
Fills in an entity from a result set

Specified by:
createFrom in class JdbcBeanDB<Address>
Parameters:
r - the result set
Returns:
the entity
Throws:
SQLException

updateObj

public void updateObj(Address addr)
               throws Exception
Description copied from interface: EntityDB
Update a KeyedEntity in the database

Specified by:
updateObj in interface EntityDB<Address>
Parameters:
addr - the KeyedEntity
Throws:
Exception


Generated September 24 2010 by mbb using Apache Ant version 1.7.1 compiled on June 27 2008 and Java version 1.6.0_20 from Sun Microsystems Inc. on Linux i386 2.6.24-28-generic