Skip to content

shutuper/spring-data-jpa-multiple-db

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Data Jpa Multiple Database configuration example

It includes repository filtering by annotations using @EnableJpaRepositories(includeFilters = ...)

It also includes Liquibase configuration for one of the databases

Just replace ${db.primary.}/${db.secondary.} in application.yml with your databases credentials.

Here you can see how to use annotation filters for your repositories: example

If you want mark your method as @Transactional you need to specify proper transactionManager (based on the db you are calling), for example:

@Transactional("primaryDataBaseTransactionManager")
public void deleteById(UUID id) {
    primaryDBEntityRepository.deleteById(id);
}

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages