cn.fantasticmao.mundo.data.partition.PartitionJpaRepositoryFactoryBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mundo-data Show documentation
Show all versions of mundo-data Show documentation
Mundo is a tiny and out-of-the-box component for business programming.
package cn.fantasticmao.mundo.data.partition;
import org.springframework.data.jpa.repository.support.JpaRepositoryFactoryBean;
import org.springframework.data.repository.core.support.RepositoryFactorySupport;
import javax.annotation.Nonnull;
import javax.persistence.EntityManager;
/**
* PartitionJpaRepositoryFactoryBean
*
* @author fantasticmao
* @version 1.0
* @since 2019/1/2
*/
public class PartitionJpaRepositoryFactoryBean extends JpaRepositoryFactoryBean {
public PartitionJpaRepositoryFactoryBean(Class repositoryInterface) {
super(repositoryInterface);
}
@Override
@Nonnull
protected RepositoryFactorySupport createRepositoryFactory(EntityManager entityManager) {
RepositoryFactorySupport repositoryFactorySupport = super.createRepositoryFactory(entityManager);
PartitionDataSourcePostProcessor partitionDataSourcePostProcessor = new PartitionDataSourcePostProcessor();
repositoryFactorySupport.addRepositoryProxyPostProcessor(partitionDataSourcePostProcessor);
return repositoryFactorySupport;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy