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

java.lang.Object
  extended by net.sf.borg.model.db.jdbc.JdbcDB
      extended by net.sf.borg.model.db.jdbc.JdbcBeanDB<Link>
          extended by net.sf.borg.model.db.jdbc.LinkJdbcDB
All Implemented Interfaces:
EntityDB<Link>, LinkDB

public class LinkJdbcDB
extends JdbcBeanDB<Link>
implements LinkDB

provides the JDBC layer for reading/writing Links


Field Summary
 
Fields inherited from class net.sf.borg.model.db.jdbc.JdbcDB
connection_
 
Constructor Summary
LinkJdbcDB()
           
 
Method Summary
 void addObj(Link att)
          Adds a KeyedEntity to the database
(package private)  Link 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.
 Collection<Link> getLinks(int ownerkey, String ownertype)
          Gets all links for a given Entity.
(package private)  PreparedStatement getPSAll()
           
(package private)  PreparedStatement getPSOne(int key)
           
 Link newObj()
          Return a new instance of the KeyedEntity
 int nextkey()
          get the next available key value for this entity type
 void updateObj(Link att)
          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

LinkJdbcDB

public LinkJdbcDB()
Method Detail

addObj

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

Specified by:
addObj in interface EntityDB<Link>
Parameters:
att - 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<Link>
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<Link>
Returns:
the next available key
Throws:
Exception

newObj

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

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

getPSOne

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

getPSAll

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

createFrom

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

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

updateObj

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

Specified by:
updateObj in interface EntityDB<Link>
Parameters:
att - the KeyedEntity
Throws:
Exception

getLinks

public Collection<Link> getLinks(int ownerkey,
                                 String ownertype)
                          throws SQLException
Description copied from interface: LinkDB
Gets all links for a given Entity.

Specified by:
getLinks in interface LinkDB
Parameters:
ownerkey - the key of the Entity
ownertype - the type of Entity
Returns:
the collection of links
Throws:
SQLException


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