org.bejug.javacareers.jobs.dao.hibernate
Class OfferDaoHibernateImpl

java.lang.Object
  extended byorg.springframework.dao.support.DaoSupport
      extended byorg.springframework.orm.hibernate3.support.HibernateDaoSupport
          extended byorg.bejug.javacareers.jobs.dao.hibernate.OfferDaoHibernateImpl
All Implemented Interfaces:
org.springframework.beans.factory.InitializingBean, OfferDao
Direct Known Subclasses:
AcademicEducationOfferDaoHibernateImpl, CommercialEducationOfferDaoHibernateImpl, ConsultingServiceOfferDaoHibernateImpl, EducationServiceOfferDaoHibernateImpl, JobOfferDaoHibernateImpl

public abstract class OfferDaoHibernateImpl
extends org.springframework.orm.hibernate3.support.HibernateDaoSupport
implements OfferDao

This class contains the common methods for all the Offer-classes.

Version:
$Revision: 1.3 $ - $Date: 2005/12/20 15:36:46 $
Author:
Bart Meyers (last modified by $Author: shally $)

Field Summary
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
OfferDaoHibernateImpl()
           
 
Method Summary
 void deleteOffer(java.lang.Integer id)
          Delete an Offer by id.
 void deleteOffer(org.bejug.javacareers.jobs.model.Offer offer)
          Delete an Offer by id.
 int deleteOffersByUrl(java.lang.String url)
          Delete an Offers by Url field.
 org.bejug.javacareers.jobs.model.Offer getOffer(java.lang.Integer id)
          Gets an Offer by id.
protected  int getOfferCount(java.lang.String namedQuery)
          conveniant method for retrieving the count of offers.
 java.util.List getOffers()
          Todo: look for a way to implement this method??? Lists all offers.
 void store(org.bejug.javacareers.jobs.model.Offer offer)
          Adds and updates an offer to the database.
 
Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport
checkDaoConfig, closeSessionIfNecessary, 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.bejug.javacareers.jobs.dao.OfferDao
getOfferCount
 

Constructor Detail

OfferDaoHibernateImpl

public OfferDaoHibernateImpl()
Method Detail

getOffers

public java.util.List getOffers()
                         throws org.springframework.dao.DataAccessException
Todo: look for a way to implement this method??? Lists all offers.

Specified by:
getOffers in interface OfferDao
Returns:
a List containing all offers
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong

store

public void store(org.bejug.javacareers.jobs.model.Offer offer)
           throws org.springframework.dao.DataAccessException
Adds and updates an offer to the database.

Specified by:
store in interface OfferDao
Parameters:
offer - the offer to add
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong when adding an offer

getOffer

public org.bejug.javacareers.jobs.model.Offer getOffer(java.lang.Integer id)
                                                throws org.springframework.dao.DataAccessException
Gets an Offer by id.

Specified by:
getOffer in interface OfferDao
Parameters:
id - the id of the Offer
Returns:
the wanted Offer of null if not found
Throws:
org.springframework.dao.DataAccessException - thrown zhen something goes wrong when getting an Offer

deleteOffer

public void deleteOffer(org.bejug.javacareers.jobs.model.Offer offer)
                 throws org.springframework.dao.DataAccessException
Delete an Offer by id.

Specified by:
deleteOffer in interface OfferDao
Parameters:
offer - The persisted offer to delete.
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong

deleteOffer

public void deleteOffer(java.lang.Integer id)
                 throws org.springframework.dao.DataAccessException
Delete an Offer by id.

Specified by:
deleteOffer in interface OfferDao
Parameters:
id - The id of the offer to delete.
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong

deleteOffersByUrl

public int deleteOffersByUrl(java.lang.String url)
                      throws org.springframework.dao.DataAccessException
Delete an Offers by Url field.

Specified by:
deleteOffersByUrl in interface OfferDao
Parameters:
url - Value of Url field of persisted offers to delete.
Returns:
int number of deleted objects
Throws:
org.springframework.dao.DataAccessException - thrown when something goes wrong

getOfferCount

protected int getOfferCount(java.lang.String namedQuery)
                     throws org.springframework.dao.DataAccessException
conveniant method for retrieving the count of offers.

Parameters:
namedQuery - the namedQuery to execute.
Returns:
an int indicating the number of offers in the database.
Throws:
org.springframework.dao.DataAccessException - when something goes wrong.


Copyright © 2005-2006 BeJUG. All Rights Reserved.