public interface Dao<T,PK extends Serializable> extends PageableDataSource<T>
| Modifier and Type | Method and Description |
|---|---|
void |
delete(Collection<T> collection)
Delete a collection of entities
|
void |
delete(T entity)
Delete an entity
|
void |
deleteById(Collection<PK> ids)
Delete a collection of Ids.
|
void |
deleteById(PK id)
Delete an object by primary key
|
boolean |
exists(PK id)
Checks for existence of an object of type T using the id arg.
|
List<T> |
findByNamedQuery(String queryName,
Map<String,Object> queryParams)
Find a list of records by using a named query
|
T |
get(PK id)
Find object by id
|
<E> E |
get(PK id,
Class<E> clazz) |
List<T> |
getAll()
Get all models
|
<E> List<E> |
getAll(Class<E> clazz) |
Class<T> |
getEntityClass()
Return the entity class
|
T |
initialize(T entity)
Initalize entity at default depth
|
T |
initialize(T entity,
int depth)
Initalize entity
|
Collection<T> |
save(Collection<T> collection)
Save a collection entity
|
T |
save(T object)
Save or update an object
|
getKeys, getPageT get(PK id)
id - the identifier (primary key) of the object to getboolean exists(PK id)
id - the id of the entityT save(T object)
object - the object to savevoid deleteById(PK id)
id - the primary keyvoid delete(T entity)
entity - to deleteList<T> findByNamedQuery(String queryName, Map<String,Object> queryParams)
queryName - query name of the named queryqueryParams - a map of the query names and the valuesT initialize(T entity)
entity - to intializeT initialize(T entity, int depth)
entity - to intializedepth - to descend.Collection<T> save(Collection<T> collection)
collection - collectin to savevoid delete(Collection<T> collection)
collection - collectin to deletevoid deleteById(Collection<PK> ids)
ids - ids to deleteCopyright © 2014 JDAL. All Rights Reserved.