Hi Michael,
I think currentDate() should work for CURRENT_TIME.
-Tom
Michael Bouschen wrote:
>Hi Mitesh, hi Tom,
>
>good catch!
>
>I'll take a look at changing the query compiler. What is the correct
>mapping for the JPQL function CURRENT_TIME? Can I use currentDate()
>since currentDateDate() does not include the time portion?
>
>Mitesh, could you do a me favor and file an issue for this? Please
>assign it to me.
>
>Regards Michael
>
>
>
>>Hi Mitesh,
>>
>> You are correct. To get the current timestamp, currentDate() should
>>be used.
>>
>>-Tom
>>
>>Mitesh Meswani wrote:
>>
>>
>>
>>>Hi Michael,
>>>The current code for query compiler maps all of these functions to
>>>Expression#currentDateDate(). Some databases(for example derby)
>>>distinguish between a TIMESTAMP type and DATE type.
>>>For example the attached program which tries to update a TIMESTAMP
>>>field on derby using "Update Employee e set e.testTimeStamp =
>>>CURRENT_TIMESTAMP" generates sql "UPDATE EMPLOYEE_TBL SET
>>>TESTTIMESTAMP = CURRENT DATE" which is not accepted by Derby. It is
>>>obvious that we will need to map this functions to different expressions
>>>
>>>Tom,
>>>>From javadocs in Expression.java, it seems that CURRENT_DATE should
>>>be mapped to Expression#currentDateDate()
>>>(ExpressionOperator.currentDate) and CURRENT_TIMESTAMP should be
>>>mapped to Expression#currentDate() (ExpressionOperator.Today) . Is
>>>that correct?
>>>
>>>Thanks,
>>>Mitesh
>>>
>>>
>>>
>>>
>>>
>
>
>
--
Tom Ware
Principal Software Engineer
Oracle Canada Inc.
Direct: (613) 783-4598
Email: tom.ware_at_oracle.com