AGGREGATE - the type of the aggregate root class.KEY - the type of the aggregate root class.@DomainRepository public interface Repository<AGGREGATE extends AggregateRoot<KEY>,KEY>
Repository
public interface ProductRepository extends Repository<Product,String> {
// nothing needed, but you can add methods with specifics
// then implements them
}
Then this interface has to be implemented by the actual repository implementation . See BaseRepository for details.| Modifier and Type | Method and Description |
|---|---|
void |
delete(AGGREGATE aggregate)
Deletes an aggregate from the persistence by its key.
|
void |
delete(KEY id)
Deprecated.
|
Class<AGGREGATE> |
getAggregateRootClass() |
Class<KEY> |
getKeyClass() |
AGGREGATE |
load(KEY id)
Loads an aggregate from the persistence by its key.
|
void |
persist(AGGREGATE aggregate)
Creates an aggregate in the persistence.
|
AGGREGATE |
save(AGGREGATE aggregate)
Updates an aggregate in the persistence
|
@Read AGGREGATE load(KEY id)
id - the aggregate key@Delete @Deprecated void delete(KEY id)
id - the aggregate key@Delete void delete(AGGREGATE aggregate)
aggregate - the aggregate to delete@Persist void persist(AGGREGATE aggregate)
aggregate - the aggregate to persist@Persist AGGREGATE save(AGGREGATE aggregate)
aggregate - the aggregate to saveCopyright © 2013-2015–2015. All rights reserved.