com.gmscheduler.model
Class DatabaseManager

java.lang.Object
  extended by com.gmscheduler.model.DatabaseManager

public class DatabaseManager
extends java.lang.Object

The DatabaseManager class handles all calls to the hibernate database for manageing the objects that are stored within it

Version:
1.0
Author:
Peter Deschere, Rebecca Beale, Jason Fillo
See Also:
http://www.hibernate.org, HibernateUtil

Constructor Summary
DatabaseManager()
           
 
Method Summary
 void deletePerson(Person p)
          Deletes a Person in a hibernate database
 void deleteSchedule(Schedule s)
          Deletes a Schedule in a hibernate database
 void deleteTimeframe(Timeframe t)
          Deletes a Timeframe in a hibernate database
 Person loadPersonById(java.lang.Long id)
          loads a Person in a hibernate database
 Person loadPersonByName(java.lang.String name)
          loads a Person in a hibernate database
 Schedule loadScheduleById(java.lang.Long id)
          loads a Schedule in a hibernate database
 Timeframe loadTimeframeById(java.lang.Long id)
          loads a Timeframe in a hibernate database
 java.util.List loadTimeframesBySchedId(java.lang.Long id)
          loads a list of Timeframes in a hibernate database
 Person storePerson(Person p)
          Stores a Person in a hibernate database
 Schedule storeSchedule(Schedule s)
          Stores a Schedule in a hibernate database
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DatabaseManager

public DatabaseManager()
Method Detail

storePerson

public Person storePerson(Person p)
Stores a Person in a hibernate database

Parameters:
p - the person to be stored
Returns:
the person which was stored

storeSchedule

public Schedule storeSchedule(Schedule s)
Stores a Schedule in a hibernate database

Parameters:
s - the schedule to be stored
Returns:
the schedule which was stored

loadTimeframeById

public Timeframe loadTimeframeById(java.lang.Long id)
loads a Timeframe in a hibernate database

Parameters:
id - the Timeframe id to be loaded
Returns:
the Timeframe which was loaded

loadPersonById

public Person loadPersonById(java.lang.Long id)
loads a Person in a hibernate database

Parameters:
id - the Person id to be loaded
Returns:
the Person which was loaded

loadPersonByName

public Person loadPersonByName(java.lang.String name)
loads a Person in a hibernate database

Parameters:
name - the Person's name to be loaded
Returns:
the Person which was loaded

loadScheduleById

public Schedule loadScheduleById(java.lang.Long id)
loads a Schedule in a hibernate database

Parameters:
id - the Schedule id to be loaded
Returns:
the Schedule which was loaded

loadTimeframesBySchedId

public java.util.List loadTimeframesBySchedId(java.lang.Long id)
loads a list of Timeframes in a hibernate database

Parameters:
id - the Schedule id of the Timeframes to be loaded
Returns:
the list of Timeframes which was loaded

deletePerson

public void deletePerson(Person p)
Deletes a Person in a hibernate database

Parameters:
p - the Person to be deleted

deleteTimeframe

public void deleteTimeframe(Timeframe t)
Deletes a Timeframe in a hibernate database

Parameters:
t - the Timeframe to be deleted

deleteSchedule

public void deleteSchedule(Schedule s)
Deletes a Schedule in a hibernate database

Parameters:
s - the Schedule to be deleted