[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5521) HqlSqlWalker transforms two same HQL-Query-trees with "java.util.Date" attribute casted as "date" different.

Daniel Migowski (JIRA) noreply at atlassian.com
Wed Sep 1 16:00:18 EDT 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-5521?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=38257#action_38257 ] 

Daniel Migowski commented on HHH-5521:
--------------------------------------

I looked at javax.persistence.Temporal, but the error still occurs. Just kidding, but we want to map that as Timestamp and not as date, and in the above clause we cast to date for a "today" filter. 

> HqlSqlWalker transforms two same HQL-Query-trees with "java.util.Date" attribute casted as "date" different.
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5521
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5521
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: core, query-hql
>    Affects Versions: 3.3.1
>         Environment: Eclipse, PostgreSQL DB Server 8.3,
> Hibernate Annotations 3.4.0.ga,
> Hibernate Commons-Annotations-3.4.0.ga,
> Hibernate Core-3.3.1.ga,
> Hibernate EntityManager 3.4.0.ga
> Hibernate Search 3.1.0.ga
> Hibernate Validator 3.1.0.ga
>            Reporter: Thomas Quathamer
>         Attachments: ASTDumpComp.txt, ASTDumpHoli.txt, ISSUE20100831.7z, ISSUE20100831.zip
>
>
> Hi, 
> we have two classes with same attribute "Date modifiedDate".
> Example Query:
> OK:		SELECT name FROM Company entity WHERE CAST(entity.modifiedDate AS date) != current_date()		
> ERROR:	SELECT name FROM Holiday entity WHERE CAST(entity.modifiedDate AS date) != current_date()
> Executing the above HQL-queries results in different AST-Nodes for the WHERE clause, 
> see the two appended AST_LOG files with the node trees 
> (line 50 in ASTNodeDump_ObjectHoliday marked by me as ERROR).
> There is a DotNode instead of an IdentNode in AST_LOG for "java.util.Date" attribute casted as "date".
> Where is the differenz?
> Thanks, Thomas Quathamer

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list