Spring Data Jpa

org.springframework.data.jpa.repository.support
Class JpaRepositoryFactoryBean<T extends JpaRepository<?,?>>

java.lang.Object
  extended by org.springframework.data.repository.support.RepositoryFactoryBeanSupport<T>
      extended by org.springframework.data.repository.support.TransactionalRepositoryFactoryBeanSupport<T>
          extended by org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean<T>
Type Parameters:
T - the type of the repository
All Implemented Interfaces:
BeanFactoryAware, FactoryBean<T>, InitializingBean

public class JpaRepositoryFactoryBean<T extends JpaRepository<?,?>>
extends org.springframework.data.repository.support.TransactionalRepositoryFactoryBeanSupport<T>

Special adapter for Springs FactoryBean interface to allow easy setup of repository factories via Spring configuration.

Author:
Oliver Gierke, Eberhard Wolff

Constructor Summary
JpaRepositoryFactoryBean()
           
 
Method Summary
 void afterPropertiesSet()
           
static
<S extends JpaRepository<?,?>>
JpaRepositoryFactoryBean<S>
create(Class<S> repositoryInterface, javax.persistence.EntityManager em)
           
protected  org.springframework.data.repository.support.RepositoryFactorySupport createRepositoryFactory()
           
protected  org.springframework.data.repository.support.RepositoryFactorySupport createRepositoryFactory(javax.persistence.EntityManager entityManager)
          Returns a RepositoryFactorySupport.
 void setEntityManager(javax.persistence.EntityManager entityManager)
          The EntityManager to be used.
 
Methods inherited from class org.springframework.data.repository.support.TransactionalRepositoryFactoryBeanSupport
getRepositoryPostProcessors, setBeanFactory, setTransactionManager
 
Methods inherited from class org.springframework.data.repository.support.RepositoryFactoryBeanSupport
getObject, getObjectType, isSingleton, setCustomImplementation, setQueryLookupStrategyKey, setRepositoryInterface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JpaRepositoryFactoryBean

public JpaRepositoryFactoryBean()
Method Detail

create

public static <S extends JpaRepository<?,?>> JpaRepositoryFactoryBean<S> create(Class<S> repositoryInterface,
                                                                                javax.persistence.EntityManager em)

setEntityManager

public void setEntityManager(javax.persistence.EntityManager entityManager)
The EntityManager to be used.

Parameters:
entityManager - the entityManager to set

createRepositoryFactory

protected org.springframework.data.repository.support.RepositoryFactorySupport createRepositoryFactory()
Specified by:
createRepositoryFactory in class org.springframework.data.repository.support.RepositoryFactoryBeanSupport<T extends JpaRepository<?,?>>

createRepositoryFactory

protected org.springframework.data.repository.support.RepositoryFactorySupport createRepositoryFactory(javax.persistence.EntityManager entityManager)
Returns a RepositoryFactorySupport.

Parameters:
entityManager -
Returns:

afterPropertiesSet

public void afterPropertiesSet()
Specified by:
afterPropertiesSet in interface InitializingBean
Overrides:
afterPropertiesSet in class org.springframework.data.repository.support.RepositoryFactoryBeanSupport<T extends JpaRepository<?,?>>

Spring Data Jpa

Copyright © 2011 SpringSource. All Rights Reserved.