[hibernate-issues] [JIRA] (HHH-9459) Cast function in HQL query for custom user type for DateTime data type

Steve Ebersole steve at hibernate.org
Fri Oct 30 09:23:02 EDT 2015


Well to be clear,  its not the UserType that is an issue.  It's the fact
that it's a composite value (a tuple).   At the db level this is casting
the (TIMESTAMP, VARCHAR) to a Date which of course is not valid.

To be honest I am inclined to either reject this as a bug or to reclassify
it as an enhancement request for a new operator

On Fri, Oct 30, 2015, 8:09 AM Christian Beikov (JIRA) <
jira at hibernate.atlassian.net> wrote:

> Christian Beikov
> <https://hibernate.atlassian.net/secure/ViewProfile.jspa?name=christian.beikov>
> *commented* on [image: Bug] HHH-9459
> <https://hibernate.atlassian.net/browse/HHH-9459>   Re: Cast function in
> HQL query for custom user type for DateTime data type
> <https://hibernate.atlassian.net/browse/HHH-9459>
>
> Good to know, I was unaware of that. Well in that case the user needs
> something like the following
>
> select e from MyEntity where :now >= cast(e.startDate.dateTime as date)
>
> The path *e.startDate.dateTime* would then resolve to a non-usertype
> which works for cast.
> [image: Add Comment]
> <https://hibernate.atlassian.net/browse/HHH-9459#add-comment> Add Comment
> <https://hibernate.atlassian.net/browse/HHH-9459#add-comment>   This
> message was sent by Atlassian JIRA (v7.0.0-OD-08-002#70107-sha1:3f098e8) [image:
> Atlassian logo]
> _______________________________________________
> hibernate-issues mailing list
> hibernate-issues at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/hibernate-issues
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/hibernate-issues/attachments/20151030/d4ff23b2/attachment.html 


More information about the hibernate-issues mailing list