From ae60ac98c6e1024b18952131b00f163cf271e123 Mon Sep 17 00:00:00 2001 From: "renovate[bot]" <29139614+renovate[bot]@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:53:37 +0000 Subject: [PATCH 01/11] chore(deps): update actions/setup-node action to v4 --- .github/workflows/lint.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index cacc6c951..858a7f3bb 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -18,7 +18,7 @@ jobs: with: fetch-depth: 0 - name: Setup Node - uses: actions/setup-node@v3 + uses: actions/setup-node@v4 with: node-version: 16.x - name: Install dependencies From 51b310d8fcd3903293c0c66c3ec7e98d8bc053d3 Mon Sep 17 00:00:00 2001 From: waahhh Date: Tue, 24 Oct 2023 03:56:46 +0900 Subject: [PATCH 02/11] feat(query-model): add JpqlLower --- .../querymodel/jpql/expression/impl/JpqlLower.kt | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt diff --git a/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt new file mode 100644 index 000000000..e716e51c3 --- /dev/null +++ b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt @@ -0,0 +1,9 @@ +package com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl + +import com.linecorp.kotlinjdsl.Internal +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expression + +@Internal +data class JpqlLower internal constructor( + val string: Expression, +) : Expression From af6b6320d337383d35f11c8f9c983309250bee9a Mon Sep 17 00:00:00 2001 From: waahhh Date: Tue, 24 Oct 2023 03:58:51 +0900 Subject: [PATCH 03/11] feat(query-model): add lower method to Expressions --- .../kotlinjdsl/querymodel/jpql/expression/Expressions.kt | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt index 8c426e982..b10bc3e2d 100644 --- a/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt +++ b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt @@ -17,6 +17,7 @@ import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlFunction import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLength import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLiteral import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLocate +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLower import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlMax import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlMin import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlMinus @@ -414,6 +415,14 @@ object Expressions { return JpqlPathType(path) } + /** + * Creates an expression that represents the string in lowercase. + */ + @SinceJdsl("3.0.0") + fun lower(string: Expression): Expression { + return JpqlLower(string) + } + /** * Creates an expression that represents the length of the string as an integer. */ From 60ff341a4426f9afb364478ca654641db9326097 Mon Sep 17 00:00:00 2001 From: waahhh Date: Tue, 24 Oct 2023 04:05:47 +0900 Subject: [PATCH 04/11] test(query-model): for lower method in Expressions --- .../querymodel/jpql/expression/ExpressionsTest.kt | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/query-model/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/ExpressionsTest.kt b/query-model/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/ExpressionsTest.kt index 37b2ce99a..da3f9bef3 100644 --- a/query-model/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/ExpressionsTest.kt +++ b/query-model/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/ExpressionsTest.kt @@ -19,6 +19,7 @@ import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlFunction import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLength import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLiteral import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLocate +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLower import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlMax import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlMin import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlMinus @@ -598,6 +599,19 @@ class ExpressionsTest : WithAssertions { assertThat(actual).isEqualTo(expected) } + @Test + fun lower() { + // when + val actual = Expressions.lower(stringExpression1) + + // then + val expected = JpqlLower( + stringExpression1, + ) + + assertThat(actual).isEqualTo(expected) + } + @Test fun length() { // when From 5a09c03e41a9eb498cd01a251719324214942800 Mon Sep 17 00:00:00 2001 From: waahhh Date: Tue, 24 Oct 2023 04:06:28 +0900 Subject: [PATCH 05/11] feat(render): add JpqlLowerSerializer --- .../render/jpql/JpqlRenderContext.kt | 2 ++ .../serializer/impl/JpqlLowerSerializer.kt | 26 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt diff --git a/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/JpqlRenderContext.kt b/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/JpqlRenderContext.kt index 1d035a1fa..54d14daec 100644 --- a/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/JpqlRenderContext.kt +++ b/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/JpqlRenderContext.kt @@ -66,6 +66,7 @@ import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlLessThanSerialize import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlLikeSerializer import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlLiteralSerializer import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlLocateSerializer +import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlLowerSerializer import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlMaxSerializer import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlMinSerializer import com.linecorp.kotlinjdsl.render.jpql.serializer.impl.JpqlMinusSerializer @@ -299,6 +300,7 @@ private class DefaultModule : JpqlRenderModule { JpqlLikeSerializer(), JpqlLiteralSerializer(), JpqlLocateSerializer(), + JpqlLowerSerializer(), JpqlMaxSerializer(), JpqlMinSerializer(), JpqlMinusSerializer(), diff --git a/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt b/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt new file mode 100644 index 000000000..c97170aba --- /dev/null +++ b/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt @@ -0,0 +1,26 @@ +package com.linecorp.kotlinjdsl.render.jpql.serializer.impl + +import com.linecorp.kotlinjdsl.Internal +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLower +import com.linecorp.kotlinjdsl.render.RenderContext +import com.linecorp.kotlinjdsl.render.jpql.serializer.JpqlRenderSerializer +import com.linecorp.kotlinjdsl.render.jpql.serializer.JpqlSerializer +import com.linecorp.kotlinjdsl.render.jpql.writer.JpqlWriter +import kotlin.reflect.KClass + +@Internal +class JpqlLowerSerializer : JpqlSerializer { + override fun handledType(): KClass { + return JpqlLower::class + } + + override fun serialize(part: JpqlLower, writer: JpqlWriter, context: RenderContext) { + val delegate = context.getValue(JpqlRenderSerializer) + + writer.write("LOWER") + + writer.writeParentheses { + delegate.serialize(part.string, writer, context) + } + } +} From 018b9049cad03f2e46c86e5862375551e9539d9f Mon Sep 17 00:00:00 2001 From: waahhh Date: Tue, 24 Oct 2023 04:11:30 +0900 Subject: [PATCH 06/11] test(render): for JpqlLowerSerializer --- .../impl/JpqlLowerSerializerTest.kt | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 render/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializerTest.kt diff --git a/render/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializerTest.kt b/render/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializerTest.kt new file mode 100644 index 000000000..b424cca5f --- /dev/null +++ b/render/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializerTest.kt @@ -0,0 +1,53 @@ +package com.linecorp.kotlinjdsl.render.jpql.serializer.impl + +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expressions +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.impl.JpqlLower +import com.linecorp.kotlinjdsl.render.TestRenderContext +import com.linecorp.kotlinjdsl.render.jpql.serializer.JpqlRenderSerializer +import com.linecorp.kotlinjdsl.render.jpql.serializer.JpqlSerializerTest +import com.linecorp.kotlinjdsl.render.jpql.writer.JpqlWriter +import io.mockk.impl.annotations.MockK +import io.mockk.verifySequence +import org.assertj.core.api.WithAssertions +import org.junit.jupiter.api.Test + +@JpqlSerializerTest +class JpqlLowerSerializerTest : WithAssertions { + private val sut = JpqlLowerSerializer() + + @MockK + private lateinit var writer: JpqlWriter + + @MockK + private lateinit var serializer: JpqlRenderSerializer + + private val stringExpression1 = Expressions.value("string1") + + @Test + fun handledType() { + // when + val actual = sut.handledType() + + // then + assertThat(actual).isEqualTo(JpqlLower::class) + } + + @Test + fun serialize() { + // given + val part = Expressions.lower( + stringExpression1, + ) + val context = TestRenderContext(serializer) + + // when + sut.serialize(part as JpqlLower, writer, context) + + // then + verifySequence { + writer.write("LOWER") + writer.writeParentheses(any()) + serializer.serialize(stringExpression1, writer, context) + } + } +} From 8e185c1003f0b7488c6b10997546390ebf5948d9 Mon Sep 17 00:00:00 2001 From: waahhh Date: Tue, 24 Oct 2023 04:13:59 +0900 Subject: [PATCH 07/11] feat(dsl): add dsl for lower function support --- .../com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt b/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt index cc13dd2d2..ac7f37535 100644 --- a/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt +++ b/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt @@ -1042,6 +1042,22 @@ open class Jpql : JpqlDsl { return Expressions.type(path.toPath()) } + /** + * Creates an expression that represents the string in lowercase. + */ + @SinceJdsl("3.0.0") + fun lower(string: String): Expression { + return Expressions.lower(Expressions.value(string)) + } + + /** + * Creates an expression that represents the string in lowercase. + */ + @SinceJdsl("3.0.0") + fun lower(string: Expressionable): Expression { + return Expressions.lower(string.toExpression()) + } + /** * Creates an expression that represents the length of the string as an integer. */ From 05a1f758ddc3172d541e85b2b93446dc63536ac5 Mon Sep 17 00:00:00 2001 From: waahhh Date: Tue, 24 Oct 2023 04:18:12 +0900 Subject: [PATCH 08/11] test(dsl): for LowerDsl --- .../dsl/jpql/expression/LowerDslTest.kt | 47 +++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 dsl/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/expression/LowerDslTest.kt diff --git a/dsl/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/expression/LowerDslTest.kt b/dsl/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/expression/LowerDslTest.kt new file mode 100644 index 000000000..bc45c2eac --- /dev/null +++ b/dsl/jpql/src/test/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/expression/LowerDslTest.kt @@ -0,0 +1,47 @@ +package com.linecorp.kotlinjdsl.dsl.jpql.expression + +import com.linecorp.kotlinjdsl.dsl.jpql.queryPart +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expression +import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expressions +import org.assertj.core.api.WithAssertions +import org.junit.jupiter.api.Test + +class LowerDslTest : WithAssertions { + private val string1 = "string1" + + private val stringExpression1 = Expressions.value("string1") + + @Test + fun `lower() with a string`() { + // when + val expression = queryPart { + lower(string1) + }.toExpression() + + val actual: Expression = expression // for type check + + // then + val expected = Expressions.lower( + Expressions.value(string1), + ) + + assertThat(actual).isEqualTo(expected) + } + + @Test + fun `lower() with a string expression`() { + // when + val expression = queryPart { + lower(stringExpression1) + }.toExpression() + + val actual: Expression = expression // for type check + + // then + val expected = Expressions.lower( + stringExpression1, + ) + + assertThat(actual).isEqualTo(expected) + } +} From ad413a5e53b023bcd78b9a43118b75989c4266c8 Mon Sep 17 00:00:00 2001 From: "jonghyon.s" Date: Tue, 24 Oct 2023 08:52:33 +0900 Subject: [PATCH 09/11] feat: remove deprecated functions --- .../com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt | 114 ------------------ 1 file changed, 114 deletions(-) diff --git a/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt b/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt index ac7f37535..0465d3bf2 100644 --- a/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt +++ b/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt @@ -2498,32 +2498,6 @@ open class Jpql : JpqlDsl { ) } - /** - * Creates a select clause in a select query. - */ - @Deprecated( - """ - The KClass parameter makes it confusing whether to specify the return type as generic or KClass - in the select function signature. - Therefore, Kotlin JDSL will remove select functions that accept the KClass parameter - to specify the return type as generic only. - Since these will be removed in the 3.0.0 release, - please use select functions that specify the return type via generic. - """, - ReplaceWith("select(expr, *exprs)"), - ) - fun select( - returnType: KClass, - expr: Expressionable<*>, - vararg exprs: Expressionable<*>, - ): SelectQueryFromStep { - return SelectQueryFromStepDsl( - returnType, - distinct = false, - listOf(expr.toExpression()) + exprs.map { it.toExpression() }, - ) - } - /** * Creates a select clause in a select query. */ @@ -2553,32 +2527,6 @@ open class Jpql : JpqlDsl { ) } - /** - * Creates a select clause in a select query. - */ - @Deprecated( - """ - The KClass parameter makes it confusing whether to specify the return type as generic or KClass - in the select function signature. - Therefore, Kotlin JDSL will remove select functions that accept the KClass parameter - to specify the return type as generic only. - Since these will be removed in the 3.0.0 release, - please use select functions that specify the return type via generic. - """, - ReplaceWith("selectDistinct(expr, *exprs)"), - ) - fun selectDistinct( - returnType: KClass, - expr: Expressionable<*>, - vararg exprs: Expressionable<*>, - ): SelectQueryFromStep { - return SelectQueryFromStepDsl( - returnType, - distinct = true, - listOf(expr.toExpression()) + exprs.map { it.toExpression() }, - ) - } - /** * Creates a select clause with the DTO projection in a select query. */ @@ -2599,37 +2547,6 @@ open class Jpql : JpqlDsl { ) } - /** - * Creates a select clause with the DTO projection in a select query. - */ - @Deprecated( - """ - The KClass parameter makes it confusing whether to specify the return type as generic or KClass - in the select function signature. - Therefore, Kotlin JDSL will remove select functions that accept the KClass parameter - to specify the return type as generic only. - Since these will be removed in the 3.0.0 release, - please use select functions that specify the return type via generic. - """, - ReplaceWith("selectNew(expr, *exprs)"), - ) - fun selectNew( - returnType: KClass, - expr: Expressionable<*>, - vararg exprs: Expressionable<*>, - ): SelectQueryFromStep { - return SelectQueryFromStepDsl( - returnType = returnType, - distinct = false, - select = listOf( - Expressions.new( - returnType, - listOf(expr.toExpression()) + exprs.map { it.toExpression() }, - ), - ), - ) - } - /** * Creates a select clause with the DTO projection in a select query. */ @@ -2650,37 +2567,6 @@ open class Jpql : JpqlDsl { ) } - /** - * Creates a select clause with the DTO projection in a select query. - */ - @Deprecated( - """ - The KClass parameter makes it confusing whether to specify the return type as generic or KClass - in the select function signature. - Therefore, Kotlin JDSL will remove select functions that accept the KClass parameter - to specify the return type as generic only. - Since these will be removed in the 3.0.0 release, - please use select functions that specify the return type via generic. - """, - ReplaceWith("selectDistinctNew(expr, *exprs)"), - ) - fun selectDistinctNew( - returnType: KClass, - expr: Expressionable<*>, - vararg exprs: Expressionable<*>, - ): SelectQueryFromStep { - return SelectQueryFromStepDsl( - returnType = returnType, - distinct = true, - select = listOf( - Expressions.new( - returnType, - listOf(expr.toExpression()) + exprs.map { it.toExpression() }, - ), - ), - ) - } - /** * Creates an update clause in an update query. */ From a4920def59ffe3e780b0393fa75d2bdcb411cafa Mon Sep 17 00:00:00 2001 From: "jonghyon.s" Date: Tue, 24 Oct 2023 08:55:06 +0900 Subject: [PATCH 10/11] feat: rename parameter of lower --- .../main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt | 8 ++++---- .../kotlinjdsl/querymodel/jpql/expression/Expressions.kt | 4 ++-- .../querymodel/jpql/expression/impl/JpqlLower.kt | 2 +- .../render/jpql/serializer/impl/JpqlLowerSerializer.kt | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt b/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt index 0465d3bf2..61c957184 100644 --- a/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt +++ b/dsl/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/dsl/jpql/Jpql.kt @@ -1046,16 +1046,16 @@ open class Jpql : JpqlDsl { * Creates an expression that represents the string in lowercase. */ @SinceJdsl("3.0.0") - fun lower(string: String): Expression { - return Expressions.lower(Expressions.value(string)) + fun lower(value: String): Expression { + return Expressions.lower(Expressions.value(value)) } /** * Creates an expression that represents the string in lowercase. */ @SinceJdsl("3.0.0") - fun lower(string: Expressionable): Expression { - return Expressions.lower(string.toExpression()) + fun lower(value: Expressionable): Expression { + return Expressions.lower(value.toExpression()) } /** diff --git a/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt index b10bc3e2d..3ac8a01f1 100644 --- a/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt +++ b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/Expressions.kt @@ -419,8 +419,8 @@ object Expressions { * Creates an expression that represents the string in lowercase. */ @SinceJdsl("3.0.0") - fun lower(string: Expression): Expression { - return JpqlLower(string) + fun lower(value: Expression): Expression { + return JpqlLower(value) } /** diff --git a/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt index e716e51c3..595f40890 100644 --- a/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt +++ b/query-model/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/querymodel/jpql/expression/impl/JpqlLower.kt @@ -5,5 +5,5 @@ import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expression @Internal data class JpqlLower internal constructor( - val string: Expression, + val value: Expression, ) : Expression diff --git a/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt b/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt index c97170aba..6706b577d 100644 --- a/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt +++ b/render/jpql/src/main/kotlin/com/linecorp/kotlinjdsl/render/jpql/serializer/impl/JpqlLowerSerializer.kt @@ -20,7 +20,7 @@ class JpqlLowerSerializer : JpqlSerializer { writer.write("LOWER") writer.writeParentheses { - delegate.serialize(part.string, writer, context) + delegate.serialize(part.value, writer, context) } } } From 7e53f6e728b15b0a915b018cae120d6061a3231f Mon Sep 17 00:00:00 2001 From: "jonghyon.s" Date: Tue, 24 Oct 2023 08:56:10 +0900 Subject: [PATCH 11/11] docs: support lower --- docs/en/jpql-with-kotlin-jdsl/expressions.md | 2 +- docs/ko/jpql-with-kotlin-jdsl/expressions.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/jpql-with-kotlin-jdsl/expressions.md b/docs/en/jpql-with-kotlin-jdsl/expressions.md index 16ce9b1d4..6dd359985 100644 --- a/docs/en/jpql-with-kotlin-jdsl/expressions.md +++ b/docs/en/jpql-with-kotlin-jdsl/expressions.md @@ -196,7 +196,7 @@ Kotlin JDSL provides functions to support built-in functions in JPA. | CONCAT | not yet | | SUBSTRING | not yet | | TRIM | not yet | -| LOWER | not yet | +| LOWER | support | | UPPER | not yet | | LENGTH | support | | LOCATE | support | diff --git a/docs/ko/jpql-with-kotlin-jdsl/expressions.md b/docs/ko/jpql-with-kotlin-jdsl/expressions.md index 2b047c459..4fb5c9875 100644 --- a/docs/ko/jpql-with-kotlin-jdsl/expressions.md +++ b/docs/ko/jpql-with-kotlin-jdsl/expressions.md @@ -195,7 +195,7 @@ Kotlin JDSL은 JPA에서 제공하는 여러 함수들을 지원하기 위함 | CONCAT | not yet | | SUBSTRING | not yet | | TRIM | not yet | -| LOWER | not yet | +| LOWER | support | | UPPER | not yet | | LENGTH | support | | LOCATE | support |