org.dartra.standard.dao.jdbc.hsqldb
Class HSQLDBGameDAO

java.lang.Object
  extended byorg.dartra.standard.dao.jdbc.BaseDAO
      extended byorg.dartra.standard.dao.jdbc.hsqldb.HSQLDBBaseDAO
          extended byorg.dartra.standard.dao.jdbc.hsqldb.HSQLDBGameDAO
All Implemented Interfaces:
org.dartra.framework.dao.DataAccessObject, org.dartra.framework.dao.GameDAO

public class HSQLDBGameDAO
extends HSQLDBBaseDAO
implements org.dartra.framework.dao.GameDAO

HSQLDB specific JDBC based implementation of the Game DAO.

This implementation of the GameDAO interface does not support data retreival. Since data is stored in an RDBMS using JDBC, there is no need to recreate the game related objects to do statistical calculations on the game data in the database.

Player, Turn and Throw objects are dependents of the Game object and are thus mapped using a Dependent Mapping [Fowler], where Game is the owning object. Hit, Location and Score are mapped using Embedded Value [Fowler].

Author:
Erwin Vervaet

Field Summary
 
Fields inherited from class org.dartra.standard.dao.jdbc.BaseDAO
loadedObjects
 
Constructor Summary
HSQLDBGameDAO(org.dartra.framework.dao.DAOFactory factory)
          Create a new game DAO, as created by given factory.
 
Method Summary
 void addGame(org.dartra.framework.Game game)
          Add given game to the persistent store.
protected  org.dartra.framework.Persistent createPersistentObject(java.lang.Object id, java.sql.ResultSet rs)
          This game DAO implementation does not support data retreival, so this method is not needed.
 java.util.Vector getGames()
          This method is not supported by this class.
 org.dartra.framework.Game getGameWithId(java.lang.Object id)
          This method is not supported by this class, so null will be returned.
 java.util.Vector getUserGames(org.dartra.framework.User user)
          This method is not supported by this class.
 
Methods inherited from class org.dartra.standard.dao.jdbc.hsqldb.HSQLDBBaseDAO
getLastPersistentObjectId
 
Methods inherited from class org.dartra.standard.dao.jdbc.BaseDAO
close, executeQuery, executeQuery, executeQuery, executeQuery, executeUpdate, getConnection, getDAOFactory, getPersistentObjectId, init, loadPersistentObject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.dartra.framework.dao.DataAccessObject
close, getConnection, getDAOFactory, init
 

Constructor Detail

HSQLDBGameDAO

public HSQLDBGameDAO(org.dartra.framework.dao.DAOFactory factory)

Create a new game DAO, as created by given factory.

Method Detail

createPersistentObject

protected org.dartra.framework.Persistent createPersistentObject(java.lang.Object id,
                                                                 java.sql.ResultSet rs)
                                                          throws java.sql.SQLException,
                                                                 org.dartra.framework.dao.DataAccessException

This game DAO implementation does not support data retreival, so this method is not needed.

Specified by:
createPersistentObject in class BaseDAO
Throws:
java.sql.SQLException
org.dartra.framework.dao.DataAccessException

addGame

public void addGame(org.dartra.framework.Game game)
             throws org.dartra.framework.dao.DataAccessException

Add given game to the persistent store.

Specified by:
addGame in interface org.dartra.framework.dao.GameDAO
Throws:
org.dartra.framework.dao.DataAccessException

getGameWithId

public org.dartra.framework.Game getGameWithId(java.lang.Object id)
                                        throws org.dartra.framework.dao.DataAccessException

This method is not supported by this class, so null will be returned.

Specified by:
getGameWithId in interface org.dartra.framework.dao.GameDAO
Throws:
org.dartra.framework.dao.DataAccessException

getGames

public java.util.Vector getGames()
                          throws org.dartra.framework.dao.DataAccessException

This method is not supported by this class. An empty list will be returned.

Specified by:
getGames in interface org.dartra.framework.dao.GameDAO
Throws:
org.dartra.framework.dao.DataAccessException

getUserGames

public java.util.Vector getUserGames(org.dartra.framework.User user)
                              throws org.dartra.framework.dao.DataAccessException

This method is not supported by this class. An empty list will be returned.

Specified by:
getUserGames in interface org.dartra.framework.dao.GameDAO
Throws:
org.dartra.framework.dao.DataAccessException