|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.domdrides.jpa.repository.JpaRepository<EntityType,IdType>
@Repository public abstract class JpaRepository<EntityType extends Entity<IdType>,IdType extends Serializable>
| Constructor Summary | |
|---|---|
protected |
JpaRepository(Class<EntityType> entityClass)
|
| Method Summary | |
|---|---|
EntityType |
add(EntityType entity)
Adds the entity to this repository. |
boolean |
contains(EntityType entity)
Returns whether or not the entity is contained within the repository. |
Set<EntityType> |
getAll()
Returns all entities in this repository as a set. |
EntityType |
getById(IdType id)
Returns the entity with the given id. |
protected Class<EntityType> |
getEntityClass()
|
protected javax.persistence.EntityManager |
getEntityManager()
|
List<EntityType> |
list(int first,
int max,
String sortProperty,
boolean ascending)
Returns one page of data from this repository. |
void |
remove(EntityType entity)
Removes the entity from this repository. |
int |
size()
Returns the size of the repository. |
EntityType |
update(EntityType entity)
Updates an entity within this repository. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected JpaRepository(Class<EntityType> entityClass)
| Method Detail |
|---|
@Transactional(readOnly=true)
public List<EntityType> list(int first,
int max,
String sortProperty,
boolean ascending)
PageableRepository
list in interface PageableRepository<EntityType extends Entity<IdType>,IdType extends Serializable>first - the first entity to returnmax - the maximum number of entities to returnsortProperty - the property to sort byascending - whether or not the sorting is asceding
@Transactional public EntityType add(EntityType entity)
Repository
add in interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>entity - the entity
@Transactional(readOnly=true) public boolean contains(EntityType entity)
Repository
contains in interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>entity - the entity
@Transactional(readOnly=true) public Set<EntityType> getAll()
Repository
getAll in interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>@Transactional(readOnly=true) public EntityType getById(IdType id)
Repository
getById in interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>id - the id
@Transactional public void remove(EntityType entity)
Repository
remove in interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>entity - the entity@Transactional(readOnly=true) public int size()
Repository
size in interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>@Transactional public EntityType update(EntityType entity)
Repository
update in interface Repository<EntityType extends Entity<IdType>,IdType extends Serializable>entity - the entity
protected Class<EntityType> getEntityClass()
protected javax.persistence.EntityManager getEntityManager()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||