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