public class JdbcAggregateTemplate extends Object implements JdbcAggregateOperations
JdbcAggregateOperations implementation, storing aggregates in and obtaining them from a JDBC data store.| Constructor and Description |
|---|
JdbcAggregateTemplate(ApplicationEventPublisher publisher,
RelationalMappingContext context,
RelationalConverter converter,
DataAccessStrategy dataAccessStrategy)
Creates a new
JdbcAggregateTemplate given ApplicationEventPublisher,
RelationalMappingContext and DataAccessStrategy. |
| Modifier and Type | Method and Description |
|---|---|
long |
count(Class<?> domainType)
Counts the number of aggregates of a given type.
|
<S> void |
delete(S aggregateRoot,
Class<S> domainType)
Delete an aggregate identified by it's aggregate root.
|
void |
deleteAll(Class<?> domainType)
Delete all aggregates of a given type.
|
<S> void |
deleteById(Object id,
Class<S> 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> 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 |
save(T instance)
Saves an instance of an aggregate, including all the members of the aggregate.
|
public JdbcAggregateTemplate(ApplicationEventPublisher publisher, RelationalMappingContext context, RelationalConverter converter, DataAccessStrategy dataAccessStrategy)
JdbcAggregateTemplate given ApplicationEventPublisher,
RelationalMappingContext and DataAccessStrategy.publisher - must not be null.context - must not be null.dataAccessStrategy - must not be null.public <T> T save(T instance)
JdbcAggregateOperationssave in interface JdbcAggregateOperationsT - the type of the aggregate root.instance - the aggregate root of the aggregate to be saved. Must not be null.public long count(Class<?> domainType)
JdbcAggregateOperationscount in interface JdbcAggregateOperationsdomainType - the type of the aggregates to be counted.null.public <T> T findById(Object id, Class<T> domainType)
JdbcAggregateOperationsfindById in interface JdbcAggregateOperationsT - 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.public <T> boolean existsById(Object id, Class<T> domainType)
JdbcAggregateOperationsexistsById in interface JdbcAggregateOperationsT - the type of the aggregate root.id - the id of the aggregate root.domainType - the type of the aggregate root.public <T> Iterable<T> findAll(Class<T> domainType)
JdbcAggregateOperationsfindAll in interface JdbcAggregateOperationsT - the type of the aggregate roots. Must not be null.domainType - the type of the aggregate roots. Must not be null.null.public <T> Iterable<T> findAllById(Iterable<?> ids, Class<T> domainType)
JdbcAggregateOperationsfindAllById in interface JdbcAggregateOperationsT - 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.public <S> void delete(S aggregateRoot,
Class<S> domainType)
JdbcAggregateOperationsdelete in interface JdbcAggregateOperationsS - the type of the aggregate root.aggregateRoot - to delete. Must not be null.domainType - the type of the aggregate root. Must not be null.public <S> void deleteById(Object id, Class<S> domainType)
JdbcAggregateOperationsdeleteById in interface JdbcAggregateOperationsS - 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.public void deleteAll(Class<?> domainType)
JdbcAggregateOperationsdeleteAll in interface JdbcAggregateOperationsdomainType - type of the aggregate roots to be deleted. Must not be null.Copyright © 2017–2019 Pivotal Software, Inc.. All rights reserved.