it.amattioli.dominate.hibernate
Class HibernateRepositoryFactory
java.lang.Object
it.amattioli.dominate.repositories.AbstractRepositoryFactory
it.amattioli.dominate.hibernate.HibernateRepositoryFactory
- All Implemented Interfaces:
- RepositoryFactory
public class HibernateRepositoryFactory
- extends AbstractRepositoryFactory
Creates a ClassHibernateRepository for objects of the given class if this class
is mapped with Hibernate.
If the given class is not mapped with Hibernate the AbstractRepositoryFactory.getRepository(Class)
method will return null.
As this class extends AbstractRepositoryFactory it will first look for a
custom factory method before trying to instantiate a default repository.
- Author:
- andrea
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HibernateRepositoryFactory
public HibernateRepositoryFactory()
getRepository
public <I extends Serializable,T extends Entity<I>> Repository<I,T> getRepository(Collection<T> coll)
- Description copied from interface:
RepositoryFactory
- 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 repositoryT - 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
getDefaultRepository
protected <I extends Serializable,T extends Entity<I>> Repository<I,T> getDefaultRepository(Class<T> c)
- Description copied from class:
AbstractRepositoryFactory
- Create a default repository for objects of class c. This method is called by
AbstractRepositoryFactory.getRepository(Class) if it cannot find a custom factory method
- Specified by:
getDefaultRepository in class AbstractRepositoryFactory
- Returns:
cloneRepository
public <I extends Serializable,T extends Entity<I>> Repository<I,T> cloneRepository(AbstractHibernateRepository<I,T> rep)
throws CloneNotSupportedException
- Throws:
CloneNotSupportedException
Copyright © 2011. All Rights Reserved.