we have two classes with same attribute "Date modifiedDate".
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
Eclipse, PostgreSQL DB Server 8.3,
Hibernate Annotations 3.4.0.ga,
Hibernate EntityManager 3.4.0.ga
Hibernate Search 3.1.0.ga
Hibernate Validator 3.1.0.ga
please take a look of the javadoc of javax.persistence.Temporal, and let me know if this helps, thanks
Maybe you could upload a non-windows-only zip format?
Converted the attachment to a more common zip format.
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.
Further investigation revealed a minor detail that might be of importance for this issue: The Entity "holiday" contains another attribute with the name "date"! When we renamed that attribute to confirm the relation to the problem, the error disappeard.