-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Separate transaction managers for Spring Data Neo4j and JPA
- Loading branch information
1 parent
972767b
commit 7c513f2
Showing
99 changed files
with
569 additions
and
241 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
plugins { | ||
id("org.orkg.gradle.kotlin-library") | ||
} | ||
|
||
dependencies { | ||
api("org.springframework:spring-core") | ||
api("org.springframework:spring-tx") | ||
} |
24 changes: 24 additions & 0 deletions
24
common/spring-data/src/main/kotlin/org/orkg/spring/data/annotations/SpringDataAnnotations.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package org.orkg.spring.data.annotations | ||
|
||
import org.springframework.core.annotation.AliasFor | ||
import org.springframework.transaction.annotation.Isolation | ||
import org.springframework.transaction.annotation.Propagation | ||
import org.springframework.transaction.annotation.Transactional | ||
|
||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
@Transactional(transactionManager = "jpaTransactionManager") | ||
annotation class TransactionalOnJPA( | ||
@get:AliasFor(annotation = Transactional::class, attribute = "readOnly") val readOnly: Boolean = false, | ||
@get:AliasFor(annotation = Transactional::class, attribute = "propagation") val propagation: Propagation = Propagation.REQUIRED, | ||
@get:AliasFor(annotation = Transactional::class, attribute = "isolation") val isolation: Isolation = Isolation.DEFAULT, | ||
) | ||
|
||
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) | ||
@Retention(AnnotationRetention.RUNTIME) | ||
@Transactional(transactionManager = "neo4jTransactionManager") | ||
annotation class TransactionalOnNeo4j( | ||
@get:AliasFor(annotation = Transactional::class, attribute = "readOnly") val readOnly: Boolean = false, | ||
@get:AliasFor(annotation = Transactional::class, attribute = "propagation") val propagation: Propagation = Propagation.REQUIRED, | ||
@get:AliasFor(annotation = Transactional::class, attribute = "isolation") val isolation: Isolation = Isolation.DEFAULT, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...n/kotlin/org/orkg/community/adapter/output/jpa/configuration/CommunityJpaConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package org.orkg.community.adapter.output.jpa.configuration | ||
|
||
import org.springframework.boot.autoconfigure.domain.EntityScan | ||
import org.springframework.context.annotation.ComponentScan | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories | ||
|
||
@Configuration | ||
@EnableJpaRepositories("org.orkg.community.adapter.output.jpa.internal") | ||
@EnableJpaRepositories("org.orkg.community.adapter.output.jpa.internal", transactionManagerRef = "jpaTransactionManager") | ||
@EntityScan("org.orkg.community.adapter.output.jpa.internal") | ||
@ComponentScan(basePackages = ["org.orkg.community.adapter.output.jpa"]) | ||
class CommunityJpaConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
...tlin/org/orkg/community/adapter/output/jpa/configuration/CommunityJpaTestConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.orkg.community.adapter.output.jpa.configuration | ||
|
||
import org.springframework.boot.test.context.TestConfiguration | ||
import org.springframework.context.annotation.Bean | ||
import org.springframework.context.annotation.ComponentScan | ||
import org.springframework.orm.jpa.JpaTransactionManager | ||
|
||
@TestConfiguration | ||
@ComponentScan("org.orkg.community.adapter.output.jpa") | ||
class CommunityJpaTestConfiguration { | ||
@Bean | ||
fun jpaTransactionManager(): JpaTransactionManager = JpaTransactionManager() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
6 changes: 3 additions & 3 deletions
6
...unity-core-services/src/main/kotlin/org/orkg/community/domain/ObservatoryFilterService.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 1 addition & 3 deletions
4
...rg/orkg/contenttypes/adapter/output/neo4j/configuration/ContentTypesNeo4jConfiguration.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
package org.orkg.contenttypes.adapter.output.neo4j.configuration | ||
|
||
import org.springframework.boot.autoconfigure.domain.EntityScan | ||
import org.springframework.context.annotation.ComponentScan | ||
import org.springframework.context.annotation.Configuration | ||
import org.springframework.data.neo4j.repository.config.EnableNeo4jRepositories | ||
|
||
@Configuration | ||
@EnableNeo4jRepositories("org.orkg.contenttypes.adapter.output.neo4j.internal") | ||
@EnableNeo4jRepositories("org.orkg.contenttypes.adapter.output.neo4j.internal", transactionManagerRef = "neo4jTransactionManager") | ||
@EntityScan("org.orkg.contenttypes.adapter.output.neo4j.internal") | ||
@ComponentScan(basePackages = ["org.orkg.contenttypes.adapter.output.neo4j.internal"]) | ||
class ContentTypesNeo4jConfiguration |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.