public interface JdbcAggregateOperations
Modifier and Type | Method and Description |
---|---|
long |
count(Class<?> domainType)
Counts the number of aggregates of a given type.
|
<T> void |
delete(T aggregateRoot,
Class<T> domainType)
Delete an aggregate identified by it's aggregate root.
|
void |
deleteAll(Class<?> domainType)
Delete all aggregates of a given type.
|
<T> void |
deleteById(Object id,
Class<T> domainType)
Deletes a single Aggregate including all entities contained in that aggregate.
|
<T> boolean |
existsById(Object id,
Class<T> domainType)
Checks if an aggregate identified by type and id exists in the database.
|
<T> Iterable<T> |
findAll(Class<T> domainType)
Load all aggregates of a given type.
|
<T> org.springframework.data.domain.Page<T> |
findAll(Class<T> domainType,
org.springframework.data.domain.Pageable pageable)
Load a page of (potentially sorted) aggregates of a given type.
|
<T> Iterable<T> |
findAll(Class<T> domainType,
org.springframework.data.domain.Sort sort)
Load all aggregates of a given type, sorted.
|
<T> Iterable<T> |
findAllById(Iterable<?> ids,
Class<T> domainType)
Load all aggregates of a given type that are identified by the given ids.
|
<T> T |
findById(Object id,
Class<T> domainType)
Load an aggregate from the database.
|
<T> T |
insert(T instance)
Dedicated insert function.
|
<T> T |
save(T instance)
Saves an instance of an aggregate, including all the members of the aggregate.
|
<T> T |
update(T instance)
Dedicated update function.
|
<T> T save(T instance)
T
- the type of the aggregate root.instance
- the aggregate root of the aggregate to be saved. Must not be null
.IncorrectUpdateSemanticsDataAccessException
- when the instance is determined to be not new and the resulting
update does not update any rows.<T> T insert(T instance)
This is useful if the client provides an id for new aggregate roots.
T
- the type of the aggregate root.instance
- the aggregate root of the aggregate to be inserted. Must not be null
.<T> T update(T instance)
T
- the type of the aggregate root.instance
- the aggregate root of the aggregate to be inserted. Must not be null
.<T> void deleteById(Object id, Class<T> domainType)
Since no version attribute is provided this method will never throw a
OptimisticLockingFailureException
. If no rows match the generated delete operation
this fact will be silently ignored.
T
- the type of the aggregate root.id
- the id of the aggregate root of the aggregate to be deleted. Must not be null
.domainType
- the type of the aggregate root.<T> void delete(T aggregateRoot, Class<T> domainType)
T
- the type of the aggregate root.aggregateRoot
- to delete. Must not be null
.domainType
- the type of the aggregate root. Must not be null
.OptimisticLockingFailureException
- when T has a version attribute and the
version attribute of the provided entity does not match the version attribute in the database, or when
there is no aggregate root with matching id. In other cases a NOOP delete is silently ignored.void deleteAll(Class<?> domainType)
domainType
- type of the aggregate roots to be deleted. Must not be null
.long count(Class<?> domainType)
domainType
- the type of the aggregates to be counted.null
.@Nullable <T> T findById(Object id, Class<T> domainType)
T
- the type of the aggregate root.id
- the id of the aggregate to load. Must not be null
.domainType
- the type of the aggregate root. Must not be null
.null
.<T> Iterable<T> findAllById(Iterable<?> ids, Class<T> domainType)
T
- the type of the aggregate roots. Must not be null
.ids
- of the aggregate roots identifying the aggregates to load. Must not be null
.domainType
- the type of the aggregate roots. Must not be null
.null
.<T> Iterable<T> findAll(Class<T> domainType)
T
- the type of the aggregate roots. Must not be null
.domainType
- the type of the aggregate roots. Must not be null
.null
.<T> boolean existsById(Object id, Class<T> domainType)
T
- the type of the aggregate root.id
- the id of the aggregate root.domainType
- the type of the aggregate root.<T> Iterable<T> findAll(Class<T> domainType, org.springframework.data.domain.Sort sort)
T
- the type of the aggregate roots. Must not be null
.domainType
- the type of the aggregate roots. Must not be null
.sort
- the sorting information. Must not be null
.null
.<T> org.springframework.data.domain.Page<T> findAll(Class<T> domainType, org.springframework.data.domain.Pageable pageable)
T
- the type of the aggregate roots. Must not be null
.domainType
- the type of the aggregate roots. Must not be null
.pageable
- the pagination information. Must not be null
.null
.Copyright © 2017–2023 Pivotal Software, Inc.. All rights reserved.