org.promotego.dao.hibernate
Class HibernateScheduledGameDao

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended by org.promotego.dao.hibernate.HibernateDaoSupport<T>
              extended by org.promotego.dao.hibernate.HibernateRadiusSearchDaoSupport<ScheduledGame>
                  extended by org.promotego.dao.hibernate.HibernateScheduledGameDao
All Implemented Interfaces:
Dao<ScheduledGame>, RadiusSearchDao<ScheduledGame>, ScheduledGameDao, org.springframework.beans.factory.InitializingBean

public class HibernateScheduledGameDao
extends HibernateRadiusSearchDaoSupport<ScheduledGame>
implements ScheduledGameDao


Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
HibernateScheduledGameDao()
           
 
Method Summary
 java.util.List<ScheduledGame> getByUser(User theUser)
           
 java.lang.String getCountQuery()
           
protected  java.lang.String getFindAllQuery()
           
 java.util.List<ScheduledGame> getGamesNeedingReminder(java.util.Date currentReminderTime, long reminderWindow)
          Retrieve a list of scheduled games from the database which are within the time period specified by the reminder window.
protected  java.lang.String getIdQuery()
           
 
Methods inherited from class org.promotego.dao.hibernate.HibernateRadiusSearchDaoSupport
findInRange, findNear
 
Methods inherited from class org.promotego.dao.hibernate.HibernateDaoSupport
create, create, delete, deleteAll, findAll, getById, getCount, reattach, saveOrUpdate, update
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.promotego.dao.interfaces.RadiusSearchDao
findNear
 
Methods inherited from interface org.promotego.dao.interfaces.Dao
create, create, delete, deleteAll, findAll, getById, getCount, reattach, saveOrUpdate, update
 

Constructor Detail

HibernateScheduledGameDao

public HibernateScheduledGameDao()
Method Detail

getFindAllQuery

protected java.lang.String getFindAllQuery()
Specified by:
getFindAllQuery in class HibernateDaoSupport<ScheduledGame>

getIdQuery

protected java.lang.String getIdQuery()
Specified by:
getIdQuery in class HibernateDaoSupport<ScheduledGame>

getCountQuery

public java.lang.String getCountQuery()
Specified by:
getCountQuery in class HibernateDaoSupport<ScheduledGame>

getByUser

public java.util.List<ScheduledGame> getByUser(User theUser)
Specified by:
getByUser in interface ScheduledGameDao

getGamesNeedingReminder

public java.util.List<ScheduledGame> getGamesNeedingReminder(java.util.Date currentReminderTime,
                                                             long reminderWindow)
Retrieve a list of scheduled games from the database which are within the time period specified by the reminder window. It is recommended that the reminder window compensate for the time between runs. ie, if you want to notify of games coming up in an hour, and runs happen every 5 minutes, then you should use an hour and 5 minutes as the reminder window. Otherwise, reminders will be sent when there is less than an hour before the game.

Specified by:
getGamesNeedingReminder in interface ScheduledGameDao
Parameters:
currentReminderTime - The current time.
reminderWindow - The amount of time in milliseconds to scan for upcoming games.
Returns:
A List of ScheduledGame objects which need reminders for the specified window.


Copyright © 2007. All Rights Reserved.