Comment définir un traitement commun pour tous les référentiels
Copiez et collez simplement le document officiel
MyRepositoryImpl.java
class MyRepositoryImpl<T, ID extends Serializable> extends SimpleJpaRepository<T, ID> {
JavaConfig.java
@Configuration
@EnableJpaRepositories(repositoryBaseClass = MyRepositoryImpl.class)
class ApplicationConfiguration { … }
or
config.xml
<repositories base-package="com.acme.repository" base-class="….MyRepositoryImpl" />
Documentation officielle https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#repositories.customize-base-repository
documentation de terasoluna http://terasolunaorg.github.io/guideline/5.3.1.RELEASE/ja/ArchitectureInDetail/DataAccessDetail/DataAccessJpa.html#custommethod-all-label
config.xml
<repositories base-package="com.acme.repository1" base-class="….MyRepository1Impl" />
<repositories base-package="com.acme.repository2" base-class="….MyRepository2Impl" />
https://stackoverflow.com/questions/15008809/multiple-jparepositories-in-xml-config-how-to-configure-with-enablejpareposit
Recommended Posts