|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object nl.gridshore.samples.training.dataaccess.jpa.BaseDaoJpa<T>
public class BaseDaoJpa<T extends nl.gridshore.samples.training.domain.BaseDomain>
Created by IntelliJ IDEA. User: jettro Date: Jan 20, 2008 Time: 5:03:11 PM Standard implementation for the base interface data access objects
Constructor Summary | |
---|---|
BaseDaoJpa(java.lang.Class<T> prototype,
java.lang.String entityName)
|
Method Summary | |
---|---|
void |
delete(T entity)
Removes the provided item from the persistent storage |
javax.persistence.EntityManager |
getEntityManager()
|
java.util.List<T> |
loadAll()
Returns list of all objects |
T |
loadById(java.lang.Long entityId)
Load the object belonging to the specified type |
protected T |
newPrototype(java.lang.Class<T> cl)
|
T |
save(T entity)
Store an existing entity |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BaseDaoJpa(java.lang.Class<T> prototype, java.lang.String entityName)
Method Detail |
---|
public T save(T entity)
BaseDao
save
in interface BaseDao<T extends nl.gridshore.samples.training.domain.BaseDomain>
entity
- Object to store
public T loadById(java.lang.Long entityId) throws org.springframework.orm.ObjectRetrievalFailureException
BaseDao
loadById
in interface BaseDao<T extends nl.gridshore.samples.training.domain.BaseDomain>
entityId
- Long representing the type of the object to load
org.springframework.orm.ObjectRetrievalFailureException
- if the entity for id does not existpublic java.util.List<T> loadAll()
BaseDao
loadAll
in interface BaseDao<T extends nl.gridshore.samples.training.domain.BaseDomain>
public void delete(T entity)
BaseDao
delete
in interface BaseDao<T extends nl.gridshore.samples.training.domain.BaseDomain>
entity
- Entity to remove from persistent storageprotected final T newPrototype(java.lang.Class<T> cl) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public javax.persistence.EntityManager getEntityManager()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |