org.dartra.framework.dao
Interface GameDAO

All Superinterfaces:
DataAccessObject

public interface GameDAO
extends DataAccessObject

Data access object for games.

The data retreival methods (getters) defined by this interface are optional. Implementing classes might elect not to implement them. They are optional because the primary goal of DarTra is tracking darts game data and calculating statistics based on this data. These calculations do not necessarily involve the use of the Java game related objects. For instance when accessing darts data in an RDMS using SQL, there is no immediate need for reconstruction of the original objects.

Persistence management for the Player, Turn and Throw objects is done by this data access object. So Player, Turn and Throw use a Dependent Mapping persistence strategy, Game being the owner object.

Author:
Erwin Vervaet

Method Summary
 void addGame(Game game)
          Add given game to the persistent store.
 java.util.Vector getGames()
          Load all game objects available in the persistent store.
 Game getGameWithId(java.lang.Object id)
          Load the game with specified persistent store id.
 java.util.Vector getUserGames(User user)
          Load all game objects for those games in which given user participated.
 
Methods inherited from interface org.dartra.framework.dao.DataAccessObject
close, getConnection, getDAOFactory, init
 

Method Detail

addGame

public void addGame(Game game)
             throws DataAccessException

Add given game to the persistent store.

Throws:
DataAccessException - When there is a problem accessing the persistent store, for instance when the given game is already present.

getGameWithId

public Game getGameWithId(java.lang.Object id)
                   throws DataAccessException

Load the game with specified persistent store id.

This is an optional method. Implementing classes might elect not to implement it and can simply return null.

Throws:
DataAccessException - When there is a problem accessing the persistent store.

getGames

public java.util.Vector getGames()
                          throws DataAccessException

Load all game objects available in the persistent store.

This is an optional method. Implementing classes might elect not to implement it and can simply return an empty list.

Throws:
DataAccessException - When there is a problem accessing the persistent store.

getUserGames

public java.util.Vector getUserGames(User user)
                              throws DataAccessException

Load all game objects for those games in which given user participated.

This is an optional method. Implementing classes might elect not to implement it and can simply return an empty list.

Throws:
DataAccessException - When there is a problem accessing the persistent store.