it.amattioli.dominate
Interface RepositoryFactory

Show UML class diagram
All Known Implementing Classes:
AbstractRepositoryFactory, CompositeRepositoryFactory, HibernateRepositoryFactory, MemoryRepositoryFactory

public interface RepositoryFactory

An abstract factory used by RepositoryRegistry to create instances of repositories.

Author:
andrea

Method Summary
<I extends Serializable,T extends Entity<I>>
Repository<I,T>
getRepository(Class<T> c)
          Create a repository for objects of the given class.
<I extends Serializable,T extends Entity<I>>
Repository<I,T>
getRepository(Collection<T> coll)
          Create an adapter that present the given collection as a repository.
 

Method Detail

getRepository

<I extends Serializable,T extends Entity<I>> Repository<I,T> getRepository(Class<T> c)
Create a repository for objects of the given class.

Type Parameters:
I - The class of the id of the objects contained in the constructed repository
T - The class of the objects contained in the constructed repository
Parameters:
c - The class object of the objects contained in the constructed repository
Returns:
a new repository for objects of class c or null if this repositoryFactory cannot create a repository for the given class

getRepository

<I extends Serializable,T extends Entity<I>> Repository<I,T> getRepository(Collection<T> coll)
Create an adapter that present the given collection as a repository.

Type Parameters:
I - The class of the id of the objects contained in the constructed repository
T - The class of the objects contained in the constructed repository
Parameters:
coll - The collection that will be adapted as a repository
Returns:
the newly created repository


Copyright © 2011. All Rights Reserved.