@ -82,95 +82,42 @@ public interface JdbcAggregateOperations {
@@ -82,95 +82,42 @@ public interface JdbcAggregateOperations {
< T > T update ( T instance ) ;
/ * *
* Deletes a single Aggregate including all entities contained in that aggregate .
* < p >
* Since no version attribute is provided this method will never throw a
* { @link org . springframework . dao . OptimisticLockingFailureException } . If no rows match the generated delete operation
* this fact will be silently ignored .
* < / p >
* Counts the number of aggregates of a given type .
*
* @param id the id of the aggregate root of the aggregate to be deleted . Must not be { @code null } .
* @param domainType the type of the aggregate root .
* @param < T > the type of the aggregate root .
* @param domainType the type of the aggregates to be counted .
* @return the number of instances stored in the database . Guaranteed to be not { @code null } .
* /
< T > void deleteById ( Object id , Class < T > domainType ) ;
long count ( Class < ? > domainType ) ;
/ * *
* Deletes all aggregates identified by their aggregate root ids .
* < p >
* Since no version attribute is provided this method will never throw a
* { @link org . springframework . dao . OptimisticLockingFailureException } . If no rows match the generated delete operation
* this fact will be silently ignored .
* < / p >
* Counts the number of aggregates of a given type that match the given < code > query < / code > .
*
* @param ids the ids of the aggregate roots of the aggregates to be deleted . Must not be { @code null } .
* @param domainType the type of the aggregate root .
* @param < T > the type of the aggregate root .
* @param query must not be { @literal null } .
* @param domainType the entity type must not be { @literal null } .
* @return the number of instances stored in the database . Guaranteed to be not { @code null } .
* @since 3 . 0
* /
< T > void deleteAllById ( Iterable < ? > ids , Class < T > domainType ) ;
< T > long count ( Query query , Class < T > domainType ) ;
/ * *
* Delete an aggregate identified by its aggregate root .
* Determine whether there are aggregates that match the { @link Query }
*
* @param aggregateRoot to delete . Must not be { @code null } .
* @param < T > the type of the aggregate root .
* @param query must not be { @literal null } .
* @param domainType the entity type must not be { @literal null } .
* @return { @literal true } if the object exists .
* @since 3 . 0
* /
< T > void delete ( T aggregateRoot ) ;
< T > boolean exists ( Query query , Class < T > domainType ) ;
/ * *
* Delete an aggregate identified by its aggregate root .
* Checks if an aggregate identified by type and id exists in the database .
*
* @param aggregateRoot to delete . Must not be { @code null } .
* @param domainType the type of the aggregate root . Must not be { @code null } .
* @param id the id of the aggregate root .
* @param domainType the type of the aggregate root .
* @param < T > the type of the aggregate root .
* @throws org . springframework . dao . OptimisticLockingFailureException when { @literal 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 .
* @deprecated since 3 . 0 use { @link # delete ( Object ) } instead
* /
@Deprecated
default < T > void delete ( T aggregateRoot , Class < T > domainType ) {
delete ( aggregateRoot ) ;
}
/ * *
* Delete all aggregates of a given type .
*
* @param domainType type of the aggregate roots to be deleted . Must not be { @code null } .
* /
void deleteAll ( Class < ? > domainType ) ;
/ * *
* Delete all aggregates identified by their aggregate roots .
*
* @param aggregateRoots to delete . Must not be { @code null } .
* @param < T > the type of the aggregate roots .
* /
< T > void deleteAll ( Iterable < ? extends T > aggregateRoots ) ;
/ * *
* Delete all aggregates identified by their aggregate roots .
*
* @param aggregateRoots to delete . Must not be { @code null } .
* @param domainType type of the aggregate roots to be deleted . Must not be { @code null } .
* @param < T > the type of the aggregate roots .
* @throws org . springframework . dao . OptimisticLockingFailureException when { @literal T } has a version attribute and for at least on entity the
* version attribute of the 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 .
* @deprecated since 3 . 0 use { @link # deleteAll ( Iterable ) } instead .
* /
@Deprecated
default < T > void deleteAll ( Iterable < ? extends T > aggregateRoots , Class < T > domainType ) {
deleteAll ( aggregateRoots ) ;
}
/ * *
* Counts the number of aggregates of a given type .
*
* @param domainType the type of the aggregates to be counted .
* @return the number of instances stored in the database . Guaranteed to be not { @code null } .
* @return whether the aggregate exists .
* /
long count ( Class < ? > domainType ) ;
< T > boolean existsById ( Object id , Class < T > domainType ) ;
/ * *
* Load an aggregate from the database .
@ -202,16 +149,6 @@ public interface JdbcAggregateOperations {
@@ -202,16 +149,6 @@ public interface JdbcAggregateOperations {
* /
< T > Iterable < T > findAll ( Class < T > domainType ) ;
/ * *
* Checks if an aggregate identified by type and id exists in the database .
*
* @param id the id of the aggregate root .
* @param domainType the type of the aggregate root .
* @param < T > the type of the aggregate root .
* @return whether the aggregate exists .
* /
< T > boolean existsById ( Object id , Class < T > domainType ) ;
/ * *
* Load all aggregates of a given type , sorted .
*
@ -238,53 +175,117 @@ public interface JdbcAggregateOperations {
@@ -238,53 +175,117 @@ public interface JdbcAggregateOperations {
* Execute a { @code SELECT } query and convert the resulting item to an entity ensuring exactly one result .
*
* @param query must not be { @literal null } .
* @param entityClass the entity type must not be { @literal null } .
* @param domainType the entity type must not be { @literal null } .
* @return exactly one result or { @link Optional # empty ( ) } if no match found .
* @throws org . springframework . dao . IncorrectResultSizeDataAccessException if more than one match found .
* @since 3 . 0
* /
< T > Optional < T > select One( Query query , Class < T > entityClass ) ;
< T > Optional < T > find One( Query query , Class < T > domainType ) ;
/ * *
* Execute a { @code SELECT } query and convert the resulting items to a { @link Iterable } that is sorted .
*
* @param query must not be { @literal null } .
* @param entityClass the entity type must not be { @literal null } .
* @param domainType the entity type must not be { @literal null } .
* @return a non - null sorted list with all the matching results .
* @throws org . springframework . dao . IncorrectResultSizeDataAccessException if more than one match found .
* @since 3 . 0
* /
< T > Iterable < T > select ( Query query , Class < T > entityClass ) ;
< T > Iterable < T > findAll ( Query query , Class < T > domainType ) ;
/ * *
* Determine whether there are aggregates that match the { @link Query }
* Returns a { @link Page } of entities matching the given { @link Query } . In case no match could be found , an empty
* { @link Page } is returned .
*
* @param query must not be { @literal null } .
* @param entityClass the entity type must not be { @literal null } .
* @return { @literal true } if the object exists .
* @param domainType the entity type must not be { @literal null } .
* @param pageable can be null .
* @return a { @link Page } of entities matching the given { @link Example } .
* @since 3 . 0
* /
< T > boolean exists ( Query query , Class < T > entityClass ) ;
< T > Page < T > findAll ( Query query , Class < T > domainType , Pageable pageable ) ;
/ * *
* Counts the number of aggregates of a given type that match the given < code > query < / code > .
* Deletes a single Aggregate including all entities contained in that aggregate .
* < p >
* Since no version attribute is provided this method will never throw a
* { @link org . springframework . dao . OptimisticLockingFailureException } . If no rows match the generated delete operation
* this fact will be silently ignored .
* < / p >
*
* @param query must not be { @literal null } .
* @param entityClass the entity type must not be { @literal null } .
* @return the number of instances stored in the database . Guaranteed to be not { @code null } .
* @since 3 . 0
* @param id the id of the aggregate root of the aggregate to be deleted . Must not be { @code null } .
* @param domainType the type of the aggregate root .
* @param < T > the type of the aggregate root .
* /
< T > long count ( Query query , Class < T > entityClass ) ;
< T > void deleteById ( Object id , Class < T > domainType ) ;
/ * *
* Returns a { @link Page } of entities matching the given { @link Query } . In case no match could be found , an empty
* { @link Page } is returned .
* Deletes all aggregates identified by their aggregate root ids .
* < p >
* Since no version attribute is provided this method will never throw a
* { @link org . springframework . dao . OptimisticLockingFailureException } . If no rows match the generated delete operation
* this fact will be silently ignored .
* < / p >
*
* @param query must not be { @literal null } .
* @param entityClass the entity type must not be { @literal null } .
* @param pageable can be null .
* @return a { @link Page } of entities matching the given { @link Example } .
* @since 3 . 0
* @param ids the ids of the aggregate roots of the aggregates to be deleted . Must not be { @code null } .
* @param domainType the type of the aggregate root .
* @param < T > the type of the aggregate root .
* /
< T > Page < T > select ( Query query , Class < T > entityClass , Pageable pageable ) ;
< T > void deleteAllById ( Iterable < ? > ids , Class < T > domainType ) ;
/ * *
* Delete an aggregate identified by its aggregate root .
*
* @param aggregateRoot to delete . Must not be { @code null } .
* @param < T > the type of the aggregate root .
* /
< T > void delete ( T aggregateRoot ) ;
/ * *
* Delete an aggregate identified by its aggregate root .
*
* @param aggregateRoot to delete . Must not be { @code null } .
* @param domainType the type of the aggregate root . Must not be { @code null } .
* @param < T > the type of the aggregate root .
* @throws org . springframework . dao . OptimisticLockingFailureException when { @literal 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 .
* @deprecated since 3 . 0 use { @link # delete ( Object ) } instead
* /
@Deprecated ( since = "3.0" )
default < T > void delete ( T aggregateRoot , Class < T > domainType ) {
delete ( aggregateRoot ) ;
}
/ * *
* Delete all aggregates of a given type .
*
* @param domainType type of the aggregate roots to be deleted . Must not be { @code null } .
* /
void deleteAll ( Class < ? > domainType ) ;
/ * *
* Delete all aggregates identified by their aggregate roots .
*
* @param aggregateRoots to delete . Must not be { @code null } .
* @param < T > the type of the aggregate roots .
* /
< T > void deleteAll ( Iterable < ? extends T > aggregateRoots ) ;
/ * *
* Delete all aggregates identified by their aggregate roots .
*
* @param aggregateRoots to delete . Must not be { @code null } .
* @param domainType type of the aggregate roots to be deleted . Must not be { @code null } .
* @param < T > the type of the aggregate roots .
* @throws org . springframework . dao . OptimisticLockingFailureException when { @literal T } has a version attribute and for
* at least on entity the version attribute of the 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 .
* @deprecated since 3 . 0 use { @link # deleteAll ( Iterable ) } instead .
* /
@Deprecated ( since = "3.0" )
default < T > void deleteAll ( Iterable < ? extends T > aggregateRoots , Class < T > domainType ) {
deleteAll ( aggregateRoots ) ;
}
}