-
Notifications
You must be signed in to change notification settings - Fork 92
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
feat: supporting localDateTime function for datetime function #628
Conversation
Codecov ReportAttention:
Additional details and impacted files@@ Coverage Diff @@
## main #628 +/- ##
==========================================
- Coverage 91.97% 91.96% -0.02%
==========================================
Files 297 299 +2
Lines 3215 3222 +7
Branches 195 195
==========================================
+ Hits 2957 2963 +6
- Misses 204 205 +1
Partials 54 54 ☔ View full report in Codecov by Sentry. |
import com.linecorp.kotlinjdsl.querymodel.jpql.expression.Expression | ||
import java.time.LocalDateTime | ||
|
||
object LocalDateTimeExpression : Expression<LocalDateTime> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add the Internal annotation
because this class belongs to an implementation.
@Internal
object LocalDateTimeExpression : Expression<LocalDateTime>
/** | ||
* Creates a datetime expression with the localDateTime. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the comment below are better. I've adopted the comments from the contributor of currentTime()
.
/**
* Creates an expression that represents the local datetime.
*
* This is the same as ```LOCAL DATETIME```.
*/
class LocalDateTimeExpressionDslTest { | ||
|
||
@Test | ||
fun `localDateTime to support LOCAL DATETIME in jpql`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -228,7 +228,7 @@ Kotlin JDSL provides a series of functions to support built-in functions in JPA. | |||
| CURRENT\_TIMESTAMP | not yet | | |||
| LOCAL DATE | not yet | | |||
| LOCAL TIME | not yet | | |||
| LOCAL DATETIME | not yet | | |||
| LOCAL DATETIME | support | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functions that are already supported should be deleted.
@@ -226,7 +226,7 @@ Kotlin JDSL은 JPA에서 제공하는 여러 함수들을 지원하기 위함 | |||
| CURRENT\_TIMESTAMP | not yet | | |||
| LOCAL DATE | not yet | | |||
| LOCAL TIME | not yet | | |||
| LOCAL DATETIME | not yet | | |||
| LOCAL DATETIME | support | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
functions that are already supported should be deleted.
writer.writeParentheses { | ||
delegate.serialize(part, writer, context) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I checked that LOCAL DATETIME
does not need parentheses. Please remove the parentheses.
@@ -887,4 +888,15 @@ class ExpressionsTest : WithAssertions { | |||
|
|||
assertThat(actual).isEqualTo(expected) | |||
} | |||
|
|||
@Test | |||
fun `localDateTime to support LOCAL DATETIME in jpql`() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As with the DSL test, please simplify the test name.
/** | ||
* Creates an expression that represents the local datetime in jpql. | ||
*/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please align the comment with DSL.
Thanks for your help! I'll fix some formatting after the merge! |
@ilgolf Sorry, I didn't see that the base branch was main and merged it. I reverted the merge on the main branch, could you please create PR to the develop branch? |
okay, sorry i miss... @shouwn |
Motivation
LOCAL DATETIME
in JPQLModifications
localDateTime()
&serializer
to supportLOCAL DATETIME
functionCommit Convention Rule
commit type
please describe it on the Pull RequestResult
LOCAL DATETIME
function in JPQLCloses