|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.paris.lutece.util.jpa.JPAGenericDAO<K,E>
K - Type of the entity's keyE - Type of the entitypublic abstract class JPAGenericDAO<K,E>
Class JPAGenericDAO
| Constructor Summary | |
|---|---|
JPAGenericDAO()
Constructor |
|
| Method Summary | |
|---|---|
void |
create(E entity)
Create an entity |
void |
detach(E entity)
Remove the given entity from the persistence context, causing a managed entity to become detached. |
java.util.List<E> |
findAll()
Find all entities |
E |
findById(K key)
Find an entity by its Id |
void |
flush()
Synchronize the persistence context to the underlying database. |
javax.persistence.EntityManager |
getEM()
Return the Entity Manager |
java.lang.Class<E> |
getEntityClass()
Gets the entity class |
java.lang.String |
getEntityClassName()
Returns the entity class name |
abstract javax.persistence.EntityManagerFactory |
getEntityManagerFactory()
Inherit classes should provide their Entity Manager Factory |
void |
remove(K key)
Remove an entity |
void |
update(E entity)
Update an entity |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JPAGenericDAO()
| Method Detail |
|---|
public abstract javax.persistence.EntityManagerFactory getEntityManagerFactory()
public java.lang.String getEntityClassName()
public java.lang.Class<E> getEntityClass()
public javax.persistence.EntityManager getEM()
public void create(E entity)
create in interface IGenericDAO<K,E>entity - The entity to createpublic void remove(K key)
remove in interface IGenericDAO<K,E>key - The key of the entity to removepublic void update(E entity)
update in interface IGenericDAO<K,E>entity - An entity that contains new valuespublic E findById(K key)
findById in interface IGenericDAO<K,E>key - The entity key
public java.util.List<E> findAll()
findAll in interface IGenericDAO<K,E>public void flush()
flush in interface IGenericDAO<K,E>public void detach(E entity)
detach in interface IGenericDAO<K,E>entity - the entity
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||