View Javadoc

1   /***
2   Copyright (C) 2005 The Java Community
3   
4   This program is free software; you can redistribute it and/or modify  it under
5   the terms of the GNU General Public License as published by  the Free Software
6   Foundation; either version 2 of the License, or  (at your option) any later
7   version.
8   
9   This program is distributed in the hope that it will be useful,  but WITHOUT
10  ANY WARRANTY; without even the implied warranty of  MERCHANTABILITY or FITNESS
11  FOR A PARTICULAR PURPOSE. See the  GNU General Public License for more details.
12  
13  You should have received a copy of the GNU General Public License  along with
14  this program; if not, write to the Free Software  Foundation, Inc., 59 Temple
15  Place, Suite 330, Boston, MA 02111-1307 USA.
16  
17  */
18  package org.bejug.javacareers.jobs.dao.hibernate;
19  
20  import org.bejug.javacareers.jobs.model.AcademicEducationOffer;
21  import org.bejug.javacareers.jobs.model.EducationOffer;
22  import org.bejug.javacareers.jobs.model.Offer;
23  import org.springframework.dao.DataAccessException;
24  
25  import java.util.List;
26  
27  /***
28   * Acedemic Education Offer hibernate dao implementation.
29   * 
30   * @author Bart Meyers (last modified by $Author: stephan_janssen $)
31   * @version $Revision: 1.3 $ $Date: 2005/10/11 08:39:00 $
32   */
33  public class AcademicEducationOfferDaoHibernateImpl
34          extends OfferDaoHibernateImpl {
35  
36      /***
37       * {@inheritDoc}
38       */
39      public List getOffers() throws DataAccessException {
40          return getHibernateTemplate().loadAll(AcademicEducationOffer.class);        
41      }
42      
43      /***
44       * {@inheritDoc}
45       */
46      public Offer getOffer(Integer id) throws DataAccessException {
47          return (Offer)
48                  getHibernateTemplate().load(AcademicEducationOffer.class, id);
49      }
50      
51      /***
52       * {@inheritDoc}
53       */
54      public void store(Offer offer) throws DataAccessException {
55          if (((EducationOffer)offer).getAddress() != null) {
56              ((EducationOffer)offer).getAddress().
57                      setModificationDate(offer.getModificationDate());
58  	    }
59  	    getHibernateTemplate().saveOrUpdate(offer);
60      }
61      
62      /***
63       * {@inheritDoc}
64       */
65      public int getOfferCount() throws DataAccessException {
66          return getOfferCount("countAcademicEducationOffers");
67      }
68  }
69  /***
70   * $Log: AcademicEducationOfferDaoHibernateImpl.java,v $
71   * Revision 1.3  2005/10/11 08:39:00  stephan_janssen
72   * Added Author CVS tag and code reformat.
73   *
74   * Revision 1.2  2005/09/13 08:11:17  schauwvliege
75   * organize imports
76   *
77   * Revision 1.1  2005/08/26 07:58:30  ge0ffrey
78   * split up the sources in service, serviceimpl and webclient
79   *
80   * Revision 1.6  2005/08/10 09:04:48  bavo_jcs
81   * Optimized imports according to checkstyle
82   *
83   * Revision 1.5  2005/08/09 12:59:55  bavo_jcs
84   * Optimized imports
85   *
86   * Revision 1.4  2005/08/03 13:14:08  bme_jcs
87   * getDao's removed and storeObject renamed to store
88   *
89   * Revision 1.3  2005/06/14 13:40:04  schauwvliege
90   * Renamed add to store
91   *
92   * Revision 1.2  2005/06/09 08:18:44  bejug_cc
93   * Fix initial import
94   *
95   * Revision 1.8  2005/05/30 14:56:58  bme
96   * added count-methods
97   *
98   * Revision 1.7  2005/05/30 09:31:47  bme
99   * updated for the introduction of HQL in the hbm-files
100  *
101  * Revision 1.6  2005/05/11 14:19:24  ssc
102  * fixed error modificationdate adress when saving education offer
103  *
104  * Revision 1.5  2005/05/11 10:14:52  ssc
105  * Checstyle errors
106  *
107  * Revision 1.4  2005/05/11 08:09:21  ssc
108  * fixed AcegiAuthenticationTest
109  *
110  * Revision 1.3  2005/05/11 07:40:17  ssc
111  * small error
112  *
113  * Revision 1.2  2005/05/10 09:54:02  ssc
114  * Removed AbstractPersistableObject
115  *
116  * Revision 1.1  2005/05/02 12:10:10  bme
117  * first release
118  *
119  */