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  package org.bejug.javacareers.jobs.dao;
18  
19  import java.util.List;
20  
21  import org.bejug.javacareers.jobs.model.Offer;
22  import org.springframework.dao.DataAccessException;
23  
24  /***
25   * General interface for OfferDao's.
26   *
27   * @author bme (last modified by $Author: schauwvliege $
28   * @version $Revision: 1.2 $ - $Date: 2005/09/13 08:11:17 $
29   */
30  public interface OfferDao {
31  
32      /***
33       * Lists all offers.
34       * @return a List containing all offers
35       * @throws DataAccessException thrown when something goes wrong
36       */
37      List getOffers() throws DataAccessException;
38  
39      /***
40       * Adds and updates an offer to the database.
41       * @param offer the offer to add
42       * @throws DataAccessException thrown when something goes wrong when adding
43       * an offer
44       */
45      void store(Offer offer) throws DataAccessException;
46  
47      /***
48       * Gets an Offer by id.
49       * @param id the id of the Offer
50       * @return the wanted Offer of null if not found
51       * @throws DataAccessException thrown zhen something goes wrong when getting
52       * an Offer
53       */
54      Offer getOffer(Integer id) throws DataAccessException;
55  
56      /***
57       * Delete an Offer by id.
58       * @param offer The persisted offer to delete.
59       * @throws DataAccessException thrown when something goes wrong
60       */
61      void deleteOffer(Offer offer) throws DataAccessException;
62  
63      /***
64       * Delete an Offer by id.
65       * @param id The id of the offer to delete.
66       * @throws DataAccessException thrown when something goes wrong
67       */
68      void deleteOffer(Integer id) throws DataAccessException;
69      
70      /***
71       * Delete an Offers by Url field.
72       * @param url Value of Url field of persisted offers to delete.
73       * @throws DataAccessException thrown when something goes wrong
74       * @return int number of deleted objects
75       */
76      int deleteOffersByUrl(String url) throws DataAccessException;
77  
78      /***
79       * Get the total number of offers.
80       * @return an int indicating the number of offers available.
81       * @throws DataAccessException thrown when something goes wrong
82       */
83      int getOfferCount() throws DataAccessException;
84  
85  
86  
87  }
88  /***
89   * $Log: OfferDao.java,v $
90   * Revision 1.2  2005/09/13 08:11:17  schauwvliege
91   * organize imports
92   *
93   * Revision 1.1  2005/08/26 07:58:30  ge0ffrey
94   * split up the sources in service, serviceimpl and webclient
95   *
96   * Revision 1.10  2005/08/10 09:04:49  bavo_jcs
97   * Optimized imports according to checkstyle
98   *
99   * Revision 1.9  2005/08/09 12:59:55  bavo_jcs
100  * Optimized imports
101  *
102  * Revision 1.8  2005/08/08 09:38:17  bme_jcs
103  * resolved checkstyle errors
104  *
105  * Revision 1.7  2005/08/05 07:50:31  psong09
106  * added named query to Offer
107  *
108  * Revision 1.6  2005/08/03 13:14:18  bme_jcs
109  * getDao's removed and storeObject renamed to store
110  *
111  * Revision 1.5  2005/06/14 13:40:04  schauwvliege
112  * Renamed add to store
113  *
114  * Revision 1.4  2005/06/14 12:05:54  schauwvliege
115  * CheckStyle and fixing tests
116  *
117  * Revision 1.3  2005/06/10 15:37:34  bavo_jcs
118  * int returned on delete
119  *
120  * Revision 1.2  2005/06/09 08:18:44  bejug_cc
121  * Fix initial import
122  *
123  * Revision 1.10  2005/05/30 14:56:58  bme
124  * added count-methods
125  *
126  * Revision 1.9  2005/05/25 11:06:53  ssc
127  * added DBUnit tests and fixed some errors
128  *
129  * Revision 1.8  2005/05/12 08:23:55  ssc
130  * Checkstyle errors
131  *
132  * Revision 1.7  2005/05/11 11:29:32  ssc
133  * Checstyle errors
134  *
135  * Revision 1.6  2005/05/10 13:31:52  bbr
136  * Added deleteOffersByUrl()
137  *
138  * Revision 1.5  2005/05/07 15:44:39  ssc
139  * added child commend and tests
140  *
141  * Revision 1.4  2005/04/29 05:58:23  bme
142  * baseclass for all offerdao's
143  *
144  * Revision 1.2  2005/04/23 14:30:50  sja
145  * changed getAllOffers to getOffers
146  *
147  * Revision 1.1  2005/04/19 11:51:22  PSONG09
148  * First release
149  *
150  * Revision 1.3  2005/04/18 18:30:58  sja
151  * Added extra CVS class header tags.
152  *
153  * Revision 1.2  2005/04/15 20:55:23  sja
154  * cleanup
155  *
156  * Revision 1.1  2005/04/15 14:44:35  sja
157  * Updated interface.
158  *
159  */