|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.dominate.repositories.CompositeRepositoryFactory
public class CompositeRepositoryFactory
A repository factory that delegates the creation of repositories to other factories.
Users can register delegate factories with addFactory(RepositoryFactory)
method. Then getRepository(Class) will try on every registered factory
until it finds one that creates the resulting repository. The factories will be
called in the same order in which they were registered.
| Constructor Summary | |
|---|---|
CompositeRepositoryFactory()
|
|
| Method Summary | ||
|---|---|---|
void |
addFactory(RepositoryFactory factory)
Register a new factory |
|
|
getRepository(Class<T> c)
Create a repository for objects of the given class. |
|
|
getRepository(Collection<T> c)
Create an adapter that present the given collection as a repository. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public CompositeRepositoryFactory()
| Method Detail |
|---|
public void addFactory(RepositoryFactory factory)
factory - the factory to registerpublic <I extends Serializable,T extends Entity<I>> Repository<I,T> getRepository(Class<T> c)
RepositoryFactory
getRepository in interface RepositoryFactoryI - The class of the id of the objects contained in the constructed repositoryT - The class of the objects contained in the constructed repositoryc - The class object of the objects contained in the constructed repository
public <I extends Serializable,T extends Entity<I>> Repository<I,T> getRepository(Collection<T> c)
RepositoryFactory
getRepository in interface RepositoryFactoryI - The class of the id of the objects contained in the constructed repositoryT - The class of the objects contained in the constructed repositoryc - The collection that will be adapted as a repository
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||