org.domdrides.jpa.repository
Class JpaRepository<E extends Entity<I>,I extends Serializable>

java.lang.Object
  extended by org.domdrides.jpa.repository.JpaRepository<E,I>
All Implemented Interfaces:
PageableRepository<E,I>, Repository<E,I>

public abstract class JpaRepository<E extends Entity<I>,I extends Serializable>
extends Object
implements PageableRepository<E,I>


Constructor Summary
protected JpaRepository(Class<E> entityClass)
           
 
Method Summary
 E add(E entity)
           
 boolean contains(E entity)
           
 Set<E> getAll()
           
 E getById(I id)
           
protected  Class<E> getEntityClass()
           
protected  javax.persistence.EntityManager getEntityManager()
           
 List<E> list(int first, int max, String sortProperty, boolean ascending)
           
protected  Set<E> queryForSet(String jpaql)
           
 void remove(E entity)
           
 int size()
           
 E update(E entity)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaRepository

protected JpaRepository(Class<E> entityClass)
Method Detail

list

public List<E> list(int first,
                    int max,
                    String sortProperty,
                    boolean ascending)
Specified by:
list in interface PageableRepository<E extends Entity<I>,I extends Serializable>

add

public E add(E entity)
Specified by:
add in interface Repository<E extends Entity<I>,I extends Serializable>

contains

public boolean contains(E entity)
Specified by:
contains in interface Repository<E extends Entity<I>,I extends Serializable>

getAll

public Set<E> getAll()
Specified by:
getAll in interface Repository<E extends Entity<I>,I extends Serializable>

getById

public E getById(I id)
Specified by:
getById in interface Repository<E extends Entity<I>,I extends Serializable>

remove

public void remove(E entity)
Specified by:
remove in interface Repository<E extends Entity<I>,I extends Serializable>

size

public int size()
Specified by:
size in interface Repository<E extends Entity<I>,I extends Serializable>

update

public E update(E entity)
Specified by:
update in interface Repository<E extends Entity<I>,I extends Serializable>

getEntityClass

protected Class<E> getEntityClass()

getEntityManager

protected javax.persistence.EntityManager getEntityManager()

queryForSet

protected Set<E> queryForSet(String jpaql)


Copyright © 2013. All Rights Reserved.