|
Spring Data Jpa | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
@Transactional(readOnly=true) public interface JpaRepository<T,ID extends Serializable>
JPA specific extension of Repository. Redeclares methods from
Repository and PagingAndSortingRepository to apply
transaction configuration to those. We need to do this to allow specific
extensions of the interface to override transaction configuration. If we'd
annotated the implementation this configuration would always enjoy precedence
over the configuration applied on an interface.
| Method Summary | |
|---|---|
Long |
count()
|
void |
delete(Iterable<? extends T> entities)
|
void |
delete(T entity)
|
void |
deleteAll()
|
void |
deleteInBatch(Iterable<T> entities)
Deletes the given entities in a batch which means it will create a single Query. |
boolean |
exists(ID id)
|
List<T> |
findAll()
|
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageable)
|
List<T> |
findAll(org.springframework.data.domain.Sort sort)
|
T |
findOne(ID id)
|
void |
flush()
Flushes all pending changes to the database. |
List<T> |
save(Iterable<? extends T> entities)
|
T |
save(T entity)
|
T |
saveAndFlush(T entity)
Saves an entity and flushes changes instantly. |
| Method Detail |
|---|
@Transactional T save(T entity)
save in interface org.springframework.data.repository.Repository<T,ID extends Serializable>@Transactional List<T> save(Iterable<? extends T> entities)
save in interface org.springframework.data.repository.Repository<T,ID extends Serializable>T findOne(ID id)
findOne in interface org.springframework.data.repository.Repository<T,ID extends Serializable>boolean exists(ID id)
exists in interface org.springframework.data.repository.Repository<T,ID extends Serializable>List<T> findAll()
findAll in interface org.springframework.data.repository.Repository<T,ID extends Serializable>Long count()
count in interface org.springframework.data.repository.Repository<T,ID extends Serializable>@Transactional void delete(T entity)
delete in interface org.springframework.data.repository.Repository<T,ID extends Serializable>@Transactional void delete(Iterable<? extends T> entities)
delete in interface org.springframework.data.repository.Repository<T,ID extends Serializable>@Transactional void deleteAll()
deleteAll in interface org.springframework.data.repository.Repository<T,ID extends Serializable>List<T> findAll(org.springframework.data.domain.Sort sort)
findAll in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>org.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageable)
findAll in interface org.springframework.data.repository.PagingAndSortingRepository<T,ID extends Serializable>@Transactional void flush()
@Transactional T saveAndFlush(T entity)
entity -
@Transactional void deleteInBatch(Iterable<T> entities)
Query. Assume that we will clear the EntityManager after
the call.
entities -
|
Spring Data Jpa | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||