Skip to content

Commit

Permalink
style: format code
Browse files Browse the repository at this point in the history
  • Loading branch information
shouwn committed Feb 19, 2024
1 parent b0e0261 commit f27809b
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
4 changes: 3 additions & 1 deletion docs/en/jpql-with-kotlin-jdsl/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ size(path(Book::authors))
* CURRENT\_DATE (currentDate)
* CURRENT\_TIME (currentTime)
* LOCAL DATE (localDate)
* LOCAL TIME (localTime)
* LOCAL DATETIME (localDateTime)

```kotlin
Expand All @@ -273,13 +274,14 @@ currentTime()

localDate()

localTime()

localDateTime()
```

| Function | DSL function |
|--------------------|--------------|
| CURRENT\_TIMESTAMP | not yet |
| LOCAL TIME | not yet |

### Database function

Expand Down
4 changes: 3 additions & 1 deletion docs/ko/jpql-with-kotlin-jdsl/expressions.md
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,7 @@ size(path(Book::authors))
* CURRENT\_DATE (currentDate)
* CURRENT\_TIME (currentTime)
* LOCAL DATE (localDate)
* LOCAL TIME (localTime)
* LOCAL DATETIME (localDateTime)

```kotlin
Expand All @@ -269,13 +270,14 @@ currentTime()

localDate()

localTime()

localDateTime()
```

| Function | DSL function |
|--------------------|--------------|
| CURRENT\_TIMESTAMP | not yet |
| LOCAL TIME | not yet |

### Database function

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ import org.junit.jupiter.api.Test
import java.time.LocalTime

class LocalTimeDslTest {

@Test
fun localTime() {
// when
val expression = queryPart {
localTime()
}.toExpression()

val actual: Expression<LocalTime> = expression
val actual: Expression<LocalTime> = expression // for type check

// then
val expected = Expressions.localTime()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,7 @@ object Expressions {
/**
* Creates an expression that represents the local date.
*
* This is the same as ```LOCAL DATE```
* This is the same as ```LOCAL DATE```.
*/
@SinceJdsl("3.4.0")
fun localDate(): Expression<LocalDate> {
Expand All @@ -339,7 +339,7 @@ object Expressions {
/**
* Creates an expression that represents the local time.
*
* Matches ```LOCAL TIME```.
* This is the same as ```LOCAL TIME```.
*/
@SinceJdsl("3.4.0")
fun localTime(): Expression<LocalTime> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -512,6 +512,7 @@ class ExpressionsTest : WithAssertions {
assertThat(actual).isEqualTo(expected)
}

@Test
fun localTime() {
// when
val actual = Expressions.localTime()
Expand All @@ -530,7 +531,6 @@ class ExpressionsTest : WithAssertions {
// then
val expected = JpqlLocalDateTime


assertThat(actual).isEqualTo(expected)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -339,8 +339,8 @@ private class DefaultModule : JpqlRenderModule {
JpqlLnSerializer(),
JpqlLocalDateSerializer(),
JpqlLocalDateTimeSerializer(),
JpqlLocateSerializer(),
JpqlLocalTimeSerializer(),
JpqlLocateSerializer(),
JpqlLowerSerializer(),
JpqlMaxSerializer(),
JpqlMinSerializer(),
Expand Down

0 comments on commit f27809b

Please sign in to comment.