public class PersistentManager<T,PK extends Serializable> extends Object implements PersistentService<T,PK>
| Modifier and Type | Field and Description |
|---|---|
protected Dao<T,PK> |
dao |
static int |
DEFAULT_DEPTH |
| Constructor and Description |
|---|
PersistentManager() |
| 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) |
Dao<T,PK> |
getDao() |
Class<T> |
getEntityClass()
Return the entity class
|
List<Serializable> |
getKeys(Page<T> page)
Gets a List with keys of page
|
<K> Page<K> |
getPage(Page<K> page)
Fill and return a page of data
|
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 entity)
Save or update an object
|
void |
setDao(Dao<T,PK> dao) |
public static final int DEFAULT_DEPTH
protected Dao<T,PK extends Serializable> dao
public void delete(T entity)
delete in interface Dao<T,PK extends Serializable>entity - to deletepublic T initialize(T entity, int depth)
initialize in interface Dao<T,PK extends Serializable>entity - to intializedepth - to descend.public T initialize(T entity)
initialize in interface Dao<T,PK extends Serializable>entity - to intializepublic List<T> getAll()
getAll in interface Dao<T,PK extends Serializable>public T save(T entity)
save in interface Dao<T,PK extends Serializable>entity - the object to savepublic void delete(Collection<T> collection)
delete in interface Dao<T,PK extends Serializable>collection - collectin to deletepublic Collection<T> save(Collection<T> collection)
save in interface Dao<T,PK extends Serializable>collection - collectin to savepublic void deleteById(PK id)
deleteById in interface Dao<T,PK extends Serializable>id - the primary keypublic void deleteById(Collection<PK> ids)
deleteById in interface Dao<T,PK extends Serializable>ids - ids to deletepublic List<Serializable> getKeys(Page<T> page)
getKeys in interface PageableDataSource<T>public <K> Page<K> getPage(Page<K> page)
getPage in interface PageableDataSource<T>public T get(PK id)
get in interface Dao<T,PK extends Serializable>id - the identifier (primary key) of the object to getpublic <E> E get(PK id, Class<E> clazz)
get in interface Dao<T,PK extends Serializable>public <E> List<E> getAll(Class<E> clazz)
getAll in interface Dao<T,PK extends Serializable>public Class<T> getEntityClass()
getEntityClass in interface Dao<T,PK extends Serializable>public boolean exists(PK id)
exists in interface Dao<T,PK extends Serializable>id - the id of the entitypublic List<T> findByNamedQuery(String queryName, Map<String,Object> queryParams)
findByNamedQuery in interface Dao<T,PK extends Serializable>queryName - query name of the named queryqueryParams - a map of the query names and the valuesCopyright © 2014 JDAL. All Rights Reserved.