Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ISSUE-708] change @Transactional readOnly for select query #709

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ allprojects {
apply(plugin = "signing")

group = "com.linecorp.kotlin-jdsl"
version = "3.4.0"
version = "3.4.1"

repositories {
mavenCentral()
Expand Down
2 changes: 1 addition & 1 deletion docs/en/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: 'Latest stable version: 3.4.0'
description: 'Latest stable version: 3.4.1'
---

# Kotlin JDSL
Expand Down
12 changes: 6 additions & 6 deletions docs/en/jpql-with-kotlin-jdsl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,8 @@ The following dependencies are the minimum requirement for all Kotlin JDSL appli

```kotlin
dependencies {
implementation("com.linecorp.kotlin-jdsl:jpql-dsl:3.4.0")
implementation("com.linecorp.kotlin-jdsl:jpql-render:3.4.0")
implementation("com.linecorp.kotlin-jdsl:jpql-dsl:3.4.1")
implementation("com.linecorp.kotlin-jdsl:jpql-render:3.4.1")
}
```

Expand All @@ -110,8 +110,8 @@ dependencies {

```groovy
dependencies {
implementation 'com.linecorp.kotlin-jdsl:jpql-dsl:3.4.0'
implementation 'com.linecorp.kotlin-jdsl:jpql-render:3.4.0'
implementation 'com.linecorp.kotlin-jdsl:jpql-dsl:3.4.1'
implementation 'com.linecorp.kotlin-jdsl:jpql-render:3.4.1'
}
```

Expand All @@ -125,12 +125,12 @@ dependencies {
<dependency>
<groupId>com.linecorp.kotlin-jdsl</groupId>
<artifactId>jpql-dsl</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.linecorp.kotlin-jdsl</groupId>
<artifactId>jpql-render</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/ko/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
description: 'Latest stable version: 3.4.0'
description: 'Latest stable version: 3.4.1'
---

# Kotlin JDSL
Expand Down
12 changes: 6 additions & 6 deletions docs/ko/jpql-with-kotlin-jdsl/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,8 @@ Kotlin JDSL을 실행시키기 위해서는 다음 dependency들이 필수로

```kotlin
dependencies {
implementation("com.linecorp.kotlin-jdsl:jpql-dsl:3.4.0")
implementation("com.linecorp.kotlin-jdsl:jpql-render:3.4.0")
implementation("com.linecorp.kotlin-jdsl:jpql-dsl:3.4.1")
implementation("com.linecorp.kotlin-jdsl:jpql-render:3.4.1")
}
```

Expand All @@ -111,8 +111,8 @@ dependencies {

```groovy
dependencies {
implementation 'com.linecorp.kotlin-jdsl:jpql-dsl:3.4.0'
implementation 'com.linecorp.kotlin-jdsl:jpql-render:3.4.0'
implementation 'com.linecorp.kotlin-jdsl:jpql-dsl:3.4.1'
implementation 'com.linecorp.kotlin-jdsl:jpql-render:3.4.1'
}
```

Expand All @@ -126,12 +126,12 @@ dependencies {
<dependency>
<groupId>com.linecorp.kotlin-jdsl</groupId>
<artifactId>jpql-dsl</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
</dependency>
<dependency>
<groupId>com.linecorp.kotlin-jdsl</groupId>
<artifactId>jpql-render</artifactId>
<version>3.4.0</version>
<version>3.4.1</version>
</dependency>
</dependencies>
```
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ import org.springframework.data.support.PageableExecutionUtilsAdaptor
import org.springframework.transaction.annotation.Transactional
import kotlin.reflect.KClass

@Transactional
@NoRepositoryBean
@Transactional(readOnly = true)
@SinceJdsl("3.0.0")
open class KotlinJdslJpqlExecutorImpl(
private val entityManager: EntityManager,
Expand Down Expand Up @@ -145,6 +145,7 @@ open class KotlinJdslJpqlExecutorImpl(
return createSlice(query, query.returnType, pageable)
}

@Transactional
override fun <T : Any> update(
init: Jpql.() -> JpqlQueryable<UpdateQuery<T>>,
): Int {
Expand All @@ -161,6 +162,7 @@ open class KotlinJdslJpqlExecutorImpl(
return jpaQuery.executeUpdate()
}

@Transactional
override fun <T : Any, DSL : JpqlDsl> update(
dsl: DSL,
init: DSL.() -> JpqlQueryable<UpdateQuery<T>>,
Expand All @@ -171,12 +173,14 @@ open class KotlinJdslJpqlExecutorImpl(
return jpaQuery.executeUpdate()
}

@Transactional
override fun <T : Any> delete(
init: Jpql.() -> JpqlQueryable<DeleteQuery<T>>,
): Int {
return delete(Jpql, init)
}

@Transactional
override fun <T : Any, DSL : JpqlDsl> delete(
dsl: JpqlDsl.Constructor<DSL>,
init: DSL.() -> JpqlQueryable<DeleteQuery<T>>,
Expand All @@ -187,6 +191,7 @@ open class KotlinJdslJpqlExecutorImpl(
return jpaQuery.executeUpdate()
}

@Transactional
override fun <T : Any, DSL : JpqlDsl> delete(
dsl: DSL,
init: DSL.() -> JpqlQueryable<DeleteQuery<T>>,
Expand Down