net.sf.easyweb4j.repository.orm.jpa
Class JPARepository<T>

java.lang.Object
  extended by net.sf.easyweb4j.repository.orm.jpa.JPARepository<T>
All Implemented Interfaces:
Serializable, ORMRepository<T>, Repository<T>

public abstract class JPARepository<T>
extends Object
implements Serializable, ORMRepository<T>

See Also:
Serialized Form

Constructor Summary
JPARepository()
           
 
Method Summary
 T find(Serializable id)
           
 T find(Serializable id, boolean lock)
           
 List<T> findAll()
           
protected  List<T> findPage(javax.persistence.Query query, int page, int pageSize)
           
protected  javax.persistence.EntityManager getCurrentEntityManager()
           
 List<T> merge(Collection<T> models)
           
 List<T> merge(T... models)
           
 T merge(T model)
           
 void persist(Collection<T> models)
           
 void persist(T... models)
           
 void persist(T model)
           
 void remove(Collection<T> models)
           
 void remove(T... models)
           
 void remove(T model)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JPARepository

public JPARepository()
Method Detail

getCurrentEntityManager

protected javax.persistence.EntityManager getCurrentEntityManager()

find

public T find(Serializable id)
Specified by:
find in interface ORMRepository<T>

find

public T find(Serializable id,
              boolean lock)
Specified by:
find in interface ORMRepository<T>

findAll

public List<T> findAll()
Specified by:
findAll in interface ORMRepository<T>

findPage

protected List<T> findPage(javax.persistence.Query query,
                           int page,
                           int pageSize)

persist

public void persist(T model)
Specified by:
persist in interface ORMRepository<T>

merge

public T merge(T model)
Specified by:
merge in interface ORMRepository<T>

remove

public void remove(T model)
Specified by:
remove in interface ORMRepository<T>

merge

public List<T> merge(T... models)
Specified by:
merge in interface ORMRepository<T>

persist

public void persist(T... models)
Specified by:
persist in interface ORMRepository<T>

remove

public void remove(T... models)
Specified by:
remove in interface ORMRepository<T>

persist

public void persist(Collection<T> models)
Specified by:
persist in interface ORMRepository<T>

merge

public List<T> merge(Collection<T> models)
Specified by:
merge in interface ORMRepository<T>

remove

public void remove(Collection<T> models)
Specified by:
remove in interface ORMRepository<T>


Copyright © 2009-2010 Chandra Sekar S. All Rights Reserved.