Hibernate version: 2.1.7c
Name and version of the database you are using: MySql 4.0.21
I'm trying to use dynamic instantiation to generate some reports and have problem using native sql function in the select clause.
Tracking the problem, I use 2 constructor
Code:
MyClass(somefields)
and
Code:
MyClass(somefields, Object o)
Using
Code:
select new MyClass(..., sum(60*60)) from ...
the 2nd constructor is used with Integer 3600 as parameter what is correct.
Using
Code:
select new MyClass(..., sum(UNIX_TIMESTAMP(EndDate))) from ...
the 1st constructor is used!!!.
I could understand that Hibernate complains about the native sql function or something like that but it seems that it is simply discarded.
Any explaination?