public interface GenericDAO<T>
| Modifier and Type | Method and Description |
|---|---|
T |
create(Context context,
T t) |
void |
delete(Context context,
T t) |
List<T> |
findAll(Context context,
Class<T> clazz)
Fetch all persisted instances of a given object type.
|
T |
findByID(Context context,
Class clazz,
int id) |
T |
findByID(Context context,
Class clazz,
UUID id) |
List<T> |
findMany(Context context,
String query)
Execute a JPQL query and return a collection of results.
|
T |
findUnique(Context context,
String query)
Execute a JPQL query returning a unique result.
|
void |
save(Context context,
T t) |
T create(Context context, T t) throws SQLException
SQLExceptionvoid save(Context context, T t) throws SQLException
SQLExceptionvoid delete(Context context, T t) throws SQLException
SQLExceptionList<T> findAll(Context context, Class<T> clazz) throws SQLException
context - clazz - the desired type.SQLExceptionT findUnique(Context context, String query) throws SQLException
context - query - SQLExceptionT findByID(Context context, Class clazz, int id) throws SQLException
SQLExceptionT findByID(Context context, Class clazz, UUID id) throws SQLException
SQLExceptionList<T> findMany(Context context, String query) throws SQLException
context - query - SQLExceptionCopyright © 2016 DuraSpace. All Rights Reserved.