Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IDaoCountries |
|
| 1.0;1 |
1 | package org.jtheque.primary.dao.able; | |
2 | ||
3 | /* | |
4 | * This file is part of JTheque. | |
5 | * | |
6 | * JTheque is free software: you can redistribute it and/or modify | |
7 | * it under the terms of the GNU General Public License as published by | |
8 | * the Free Software Foundation, either version 3 of the License. | |
9 | * | |
10 | * JTheque is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | * GNU General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU General Public License | |
16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
17 | */ | |
18 | ||
19 | import org.jtheque.core.managers.persistence.able.JThequeDao; | |
20 | import org.jtheque.primary.od.able.Country; | |
21 | ||
22 | import java.util.Collection; | |
23 | ||
24 | /** | |
25 | * A DAO for countries specification. | |
26 | * | |
27 | * @author Baptiste Wicht | |
28 | */ | |
29 | public interface IDaoCountries extends JThequeDao { | |
30 | String TABLE = "T_COUNTRIES"; | |
31 | ||
32 | /** | |
33 | * Return all the countries. | |
34 | * | |
35 | * @return A <code>Collection</code> containing all the countries. | |
36 | */ | |
37 | Collection<Country> getCountries(); | |
38 | ||
39 | /** | |
40 | * Return the country of the specified id. | |
41 | * | |
42 | * @param id The searched id. | |
43 | * @return The country of the specified id or <code>null</code> if there is no country with this id. | |
44 | */ | |
45 | Country getCountry(int id); | |
46 | ||
47 | /** | |
48 | * Return the country of the specified title. | |
49 | * | |
50 | * @param title The searched title. | |
51 | * @return The country of the specified title or <code>null</code> if there is no country with this title. | |
52 | */ | |
53 | Country getCountry(String title); | |
54 | ||
55 | /** | |
56 | * Indicate if the country exist in the Dao. | |
57 | * | |
58 | * @param country The country we must test if it's exist. | |
59 | * @return <code>true</code> if the country exist else <code>false</code>. | |
60 | */ | |
61 | boolean exist(Country country); | |
62 | ||
63 | /** | |
64 | * Delete a country. | |
65 | * | |
66 | * @param country The country to delete | |
67 | * @return <code>true</code> if the object has been deleted else <code>false</code>. | |
68 | */ | |
69 | boolean delete(Country country); | |
70 | ||
71 | /** | |
72 | * Create the country. | |
73 | * | |
74 | * @param country The country to create | |
75 | */ | |
76 | void create(Country country); | |
77 | ||
78 | /** | |
79 | * Save the country on the database. | |
80 | * | |
81 | * @param country The country to save. | |
82 | */ | |
83 | void save(Country country); | |
84 | ||
85 | /** | |
86 | * Create a new <code>Country</code>. | |
87 | * | |
88 | * @return The created <code>Country</code>. | |
89 | */ | |
90 | Country createCountry(); | |
91 | } |