|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GenericDao<T extends DomainObject>
A generic ancestor of all interfaces from the Dao layer.
Method Summary | ||
---|---|---|
boolean |
contains(T entity)
Returns true if the entity is persisted |
|
boolean |
containsById(Long id)
Returns true if entity with given id is persisted |
|
void |
create(T entity)
Persists the entity |
|
void |
delete(T entity)
Deletes the entity from the database |
|
List<T> |
findAll()
Returns list of all entities in natural sort order. |
|
T |
findById(long id)
Finds the object by its id |
|
T |
findById(long id,
boolean lock)
Finds the object by its id |
|
List<T> |
findByIDs(long[] IDs,
boolean lck)
Searches for the objects by their respective id's. |
|
void |
flush()
flushes the cachce to the database |
|
Class<? extends T> |
getPersistentClass()
Returns the type of the implemented dato |
|
|
refresh(T entity)
Refreshes the entity from the database |
|
List |
runNamedQuery(String name,
Map<String,Object> params)
Runs named query |
|
Object |
runNamedQueryForSingleResult(String name,
Map<String,Object> params)
Runs named query which should return single result |
|
T |
save(T entity)
Merge the state of the given entity into the current dao context. |
|
T |
update(T entity)
Update the persistent instance with the identifier of the given detached instance. |
Method Detail |
---|
T findById(long id, boolean lock)
id
- of the objectlock
- if the object should be locked in the database
T findById(long id)
id
- of the object
List<T> findAll()
List<T> findByIDs(long[] IDs, boolean lck)
IDs
- lck
-
T save(T entity)
entity
-
T update(T entity)
entity
- a detached instance containing updated stateSession.update(Object)
void create(T entity)
entity
- boolean contains(T entity)
entity
-
boolean containsById(Long id)
id
-
void delete(T entity)
entity
- <T> T refresh(T entity)
entity
-
void flush()
List runNamedQuery(String name, Map<String,Object> params)
name
- of the queryparams
-
Object runNamedQueryForSingleResult(String name, Map<String,Object> params)
name
- of the queryparams
-
Class<? extends T> getPersistentClass()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |