com.threerings.parlor.tourney.server.persist
Class TourneyRepository

java.lang.Object
  extended by com.samskivert.jdbc.Repository
      extended by com.samskivert.jdbc.SimpleRepository
          extended by com.samskivert.jdbc.JORARepository
              extended by com.threerings.parlor.tourney.server.persist.TourneyRepository

public class TourneyRepository
extends JORARepository

The persistent store for tourney related information.


Nested Class Summary
static class TourneyRepository.TourneyRecord
          Contains tourney information loaded from the database.
 
Nested classes/interfaces inherited from class com.samskivert.jdbc.SimpleRepository
SimpleRepository.PreCondition
 
Nested classes/interfaces inherited from class com.samskivert.jdbc.Repository
Repository.Operation<V>
 
Field Summary
protected  Table<TourneyRepository.TourneyRecord> _ttable
           
static String TOURNEY_DB_IDENT
          The database identifier used when establishing a database connection.
 
Fields inherited from class com.samskivert.jdbc.SimpleRepository
_dbident, _precond
 
Fields inherited from class com.samskivert.jdbc.Repository
_provider
 
Constructor Summary
TourneyRepository(ConnectionProvider conprov)
           
 
Method Summary
protected  void createTables()
           
 void deleteTourney(int tourneyId)
          Deletes a tourney from the repository.
 void insertTourney(TourneyConfig tourney)
          Inserts a new tourney into the repository, assigning a unique id to the tourney.
 ArrayList<TourneyConfig> loadTournies()
          Loads all the tourney configs from the repository.
protected  void migrateSchema(Connection conn, DatabaseLiaison liaison)
           
 void updateTourney(TourneyConfig tourney)
          Updates the tourney in the repository.
 
Methods inherited from class com.samskivert.jdbc.JORARepository
delete, insert, load, load, loadAll, loadAll, loadAllByExample, loadAllByExample, loadByExample, loadByExample, store, update, update, updateField, updateFields
 
Methods inherited from class com.samskivert.jdbc.SimpleRepository
checkedUpdate, configureDatabaseIdent, execute, execute, executeUpdate, gotConnection, maintenance, setExecutePreCondition, toString, update, warnedUpdate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOURNEY_DB_IDENT

public static final String TOURNEY_DB_IDENT
The database identifier used when establishing a database connection. This value being tourneydb.

See Also:
Constant Field Values

_ttable

protected Table<TourneyRepository.TourneyRecord> _ttable
Constructor Detail

TourneyRepository

@Inject
public TourneyRepository(ConnectionProvider conprov)
Method Detail

insertTourney

public void insertTourney(TourneyConfig tourney)
                   throws PersistenceException
Inserts a new tourney into the repository, assigning a unique id to the tourney.

Throws:
PersistenceException

updateTourney

public void updateTourney(TourneyConfig tourney)
                   throws PersistenceException
Updates the tourney in the repository.

Throws:
PersistenceException

deleteTourney

public void deleteTourney(int tourneyId)
                   throws PersistenceException
Deletes a tourney from the repository.

Throws:
PersistenceException

loadTournies

public ArrayList<TourneyConfig> loadTournies()
                                      throws PersistenceException
Loads all the tourney configs from the repository.

Throws:
PersistenceException

migrateSchema

protected void migrateSchema(Connection conn,
                             DatabaseLiaison liaison)
                      throws SQLException,
                             PersistenceException
Overrides:
migrateSchema in class SimpleRepository
Throws:
SQLException
PersistenceException

createTables

protected void createTables()
Specified by:
createTables in class JORARepository