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.CommercialEducationOffer;
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 * Commercial Education Offer Hibernate dao implementation.
29 *
30 * @author Bart Meyers (Last modified by $Author: shally $)
31 * @version $Revision: 1.5 $ - $Date: 2005/12/09 10:46:55 $
32 */
33 public class CommercialEducationOfferDaoHibernateImpl extends
34 OfferDaoHibernateImpl {
35
36 /***
37 * {@inheritDoc}
38 */
39 public List getOffers() throws DataAccessException {
40 return getHibernateTemplate().loadAll(CommercialEducationOffer.class);
41 }
42
43 /***
44 * {@inheritDoc}
45 */
46 public Offer getOffer(Integer id) throws DataAccessException {
47 return (Offer) getHibernateTemplate().
48 load(CommercialEducationOffer.class, id);
49 }
50
51 /***
52 * {@inheritDoc}
53 */
54 public void store(EducationOffer offer) throws DataAccessException {
55 if (offer.getAddress() != null) {
56 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("countCommercialEducationOffers");
67 }
68 }
69 /***
70 * $Log: CommercialEducationOfferDaoHibernateImpl.java,v $
71 * Revision 1.5 2005/12/09 10:46:55 shally
72 * Opkuis voor checkstyle en PMD
73 *
74 * Revision 1.4 2005/10/11 08:41:48 stephan_janssen
75 * Code reformat + javadoc.
76 *
77 * Revision 1.3 2005/09/13 08:11:17 schauwvliege
78 * organize imports
79 *
80 * Revision 1.2 2005/09/09 10:54:04 bavo_jcs
81 * Added CommercialEducationOffer
82 *
83 * Revision 1.1 2005/08/26 07:58:30 ge0ffrey
84 * split up the sources in service, serviceimpl and webclient
85 *
86 * Revision 1.6 2005/08/10 09:04:48 bavo_jcs
87 * Optimized imports according to checkstyle
88 *
89 * Revision 1.5 2005/08/09 12:59:55 bavo_jcs
90 * Optimized imports
91 *
92 * Revision 1.4 2005/08/03 13:14:09 bme_jcs
93 * getDao's removed and storeObject renamed to store
94 *
95 * Revision 1.3 2005/06/14 13:40:04 schauwvliege
96 * Renamed add to store
97 *
98 * Revision 1.2 2005/06/09 08:18:44 bejug_cc
99 * Fix initial import
100 *
101 * Revision 1.5 2005/05/30 14:56:58 bme
102 * added count-methods
103 *
104 * Revision 1.4 2005/05/30 09:31:47 bme
105 * updated for the introduction of HQL in the hbm-files
106 *
107 * Revision 1.3 2005/05/11 14:19:24 ssc
108 * fixed error modificationdate adress when saving education offer
109 *
110 * Revision 1.2 2005/05/11 10:14:52 ssc
111 * Checstyle errors
112 *
113 * Revision 1.1 2005/05/02 12:10:10 bme
114 * first release
115 *
116 */