diff --git a/docs/en/jpql-with-kotlin-jdsl/expressions.md b/docs/en/jpql-with-kotlin-jdsl/expressions.md index ec118d430..9a5fd976f 100644 --- a/docs/en/jpql-with-kotlin-jdsl/expressions.md +++ b/docs/en/jpql-with-kotlin-jdsl/expressions.md @@ -223,8 +223,8 @@ Kotlin JDSL provides a series of functions to support built-in functions in JPA. | Function | DSL function | |--------------------|--------------| -| CURRENT\_DATE | not yet | -| CURRENT\_TIME | not yet | +| CURRENT\_DATE | support | +| CURRENT\_TIME | support | | CURRENT\_TIMESTAMP | not yet | | LOCAL DATE | not yet | | LOCAL TIME | not yet | diff --git a/docs/ko/jpql-with-kotlin-jdsl/expressions.md b/docs/ko/jpql-with-kotlin-jdsl/expressions.md index e77eadfec..05958c291 100644 --- a/docs/ko/jpql-with-kotlin-jdsl/expressions.md +++ b/docs/ko/jpql-with-kotlin-jdsl/expressions.md @@ -221,8 +221,8 @@ Kotlin JDSL은 JPA에서 제공하는 여러 함수들을 지원하기 위함 | Function | DSL function | |--------------------|--------------| -| CURRENT\_DATE | not yet | -| CURRENT\_TIME | not yet | +| CURRENT\_DATE | support | +| CURRENT\_TIME | support | | CURRENT\_TIMESTAMP | not yet | | LOCAL DATE | not yet | | LOCAL TIME | not yet | 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 bc4ee6d0a..d27e82425 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 @@ -44,6 +44,8 @@ import com.linecorp.kotlinjdsl.querymodel.jpql.select.SelectQuery import com.linecorp.kotlinjdsl.querymodel.jpql.sort.Sort import java.math.BigDecimal import java.math.BigInteger +import java.sql.Date +import java.sql.Time import kotlin.internal.Exact import kotlin.internal.LowPriorityInOverloadResolution import kotlin.reflect.KClass @@ -1380,6 +1382,26 @@ open class Jpql : JpqlDsl { ) } + /** + * Creates an expression that represents the current date. + * + * This is the same as ```CURRENT_DATE```. + */ + @SinceJdsl("3.4.0") + fun currentDate(): Expression { + return Expressions.currentDate() + } + + /** + * Creates an expression that represents the current time. + * + * This is the same as ```CURRENT_TIME```. + */ + @SinceJdsl("3.4.0") + fun currentTime(): Expression