32 |
32 |
33 public interface GenericDao<T> { |
33 public interface GenericDao<T> { |
34 |
34 |
35 /** |
35 /** |
36 * Finds an entity by its integer ID. |
36 * Finds an entity by its integer ID. |
|
37 * It is not guaranteed that referenced entities are automatically joined. |
37 * |
38 * |
38 * @param id the id |
39 * @param id the id |
39 * @return the enity or null if there is no such entity |
40 * @return the enity or null if there is no such entity |
40 * @throws SQLException on any kind of SQL errors |
41 * @throws SQLException on any kind of SQL errors |
41 */ |
42 */ |
42 T find(int id) throws SQLException; |
43 T find(int id) throws SQLException; |
43 |
44 |
44 /** |
45 /** |
45 * Inserts an instance into database. |
46 * Inserts an instance into database. |
|
47 * It is not guaranteed that generated fields will be updated in the instance. |
46 * |
48 * |
47 * @param instance the instance to insert |
49 * @param instance the instance to insert |
48 * @throws SQLException on any kind of SQL errors |
50 * @throws SQLException on any kind of SQL errors |
49 */ |
51 */ |
50 void save(T instance) throws SQLException; |
52 void save(T instance) throws SQLException; |