Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
IDaoLanguages |
|
| 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.Language; | |
21 | ||
22 | import java.util.Collection; | |
23 | ||
24 | /** | |
25 | * A DAO for languages specification. | |
26 | * | |
27 | * @author Baptiste Wicht | |
28 | */ | |
29 | public interface IDaoLanguages extends JThequeDao { | |
30 | String TABLE = "T_LANGUAGES"; | |
31 | ||
32 | /** | |
33 | * Return all the countries. | |
34 | * | |
35 | * @return A <code>Collection</code> containing all the languages. | |
36 | */ | |
37 | Collection<Language> getLanguages(); | |
38 | ||
39 | /** | |
40 | * Return the language of the specified id. | |
41 | * | |
42 | * @param id The searched id. | |
43 | * @return The language of the specified id or <code>null</code> if there is no language with this id. | |
44 | */ | |
45 | Language getLanguage(int id); | |
46 | ||
47 | /** | |
48 | * Return the language of the specified title. | |
49 | * | |
50 | * @param title The searched title. | |
51 | * @return The language of the specified title or <code>null</code> if there is no language with this title. | |
52 | */ | |
53 | Language getLanguage(String title); | |
54 | ||
55 | /** | |
56 | * Indicate if the language exist in the Dao. | |
57 | * | |
58 | * @param language The language we must test if it's exist. | |
59 | * @return <code>true</code> if the language exist else <code>false</code>. | |
60 | */ | |
61 | boolean exist(Language language); | |
62 | ||
63 | /** | |
64 | * Create a new language. | |
65 | * | |
66 | * @param language The language to create | |
67 | */ | |
68 | void create(Language language); | |
69 | ||
70 | /** | |
71 | * Save the language. | |
72 | * | |
73 | * @param language The language to save | |
74 | */ | |
75 | void save(Language language); | |
76 | ||
77 | /** | |
78 | * Delete a language. | |
79 | * | |
80 | * @param language The language to delete | |
81 | * @return <code>true</code> if the object has been deleted else <code>false</code>. | |
82 | */ | |
83 | boolean delete(Language language); | |
84 | ||
85 | /** | |
86 | * Create a new <code>Language</code>. | |
87 | * | |
88 | * @return The created <code>Language</code>. | |
89 | */ | |
90 | Language createLanguage(); | |
91 | } |