T
- Your resource POJO to manage, maybe an entity or DTO classID
- Resource id type, usually Long or Stringpublic interface CrudService<T,ID extends Serializable>
Modifier and Type | Method and Description |
---|---|
Long |
count()
Count all resources.
|
T |
create(T resource)
Create new resource.
|
void |
delete(ID id)
Delete existing resource.
|
void |
delete(T resource)
Delete existing resource.
|
void |
deleteAll()
Delete all existing resource.
|
void |
deleteAllWithCascade()
Delete all existing resource, including linked entities with cascade delete
|
Iterable<T> |
findAll()
Find all resources.
|
org.springframework.data.domain.Page<T> |
findAll(org.springframework.data.domain.Pageable pageRequest)
Find all resources (pageable).
|
T |
findById(ID id)
Find resource by id.
|
Iterable<T> |
findByIds(Set<ID> ids)
Find resources by their ids.
|
T |
update(T resource)
Update existing resource.
|
T create(T resource)
resource
- Resource to createT update(T resource)
resource
- Resource to updatevoid delete(T resource)
resource
- Resource to deletevoid delete(ID id)
id
- Resource idvoid deleteAll()
void deleteAllWithCascade()
Iterable<T> findByIds(Set<ID> ids)
ids
- Resource idsorg.springframework.data.domain.Page<T> findAll(org.springframework.data.domain.Pageable pageRequest)
pageRequest
- page requestLong count()
Copyright © 2009–2014. All rights reserved.