AGGREGATE - the aggregate root typeKEY - the key typepublic abstract class BaseRepository<AGGREGATE extends AggregateRoot<KEY>,KEY> extends Object implements Repository<AGGREGATE,KEY>
| Modifier and Type | Field and Description |
|---|---|
protected Class<AGGREGATE> |
aggregateRootClass |
protected Class<KEY> |
keyClass |
| Modifier | Constructor and Description |
|---|---|
protected |
BaseRepository()
Constructs a base repository.
|
protected |
BaseRepository(Class<AGGREGATE> aggregateRootClass,
Class<KEY> keyClass)
Constructs a base repository settings explicitly the aggregate root class and the key class.
|
| Modifier and Type | Method and Description |
|---|---|
Class<AGGREGATE> |
getAggregateRootClass() |
Class<KEY> |
getKeyClass() |
protected final Class<AGGREGATE extends AggregateRoot<KEY>> aggregateRootClass
protected BaseRepository()
The aggregate root class and the key class are found by reflection.
protected BaseRepository(Class<AGGREGATE> aggregateRootClass, Class<KEY> keyClass)
This is used when the implementation class does not resolve the generics. Since the generic types can't be resolve at runtime, they should be passed explicitly.
aggregateRootClass - the aggregate root classkeyClass - the key classpublic Class<AGGREGATE> getAggregateRootClass()
getAggregateRootClass in interface Repository<AGGREGATE extends AggregateRoot<KEY>,KEY>public Class<KEY> getKeyClass()
getKeyClass in interface Repository<AGGREGATE extends AggregateRoot<KEY>,KEY>Copyright © 2013-2016–2016 SeedStack. All rights reserved.