-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Dynamic instatiation with native sql function
PostPosted: Tue Dec 07, 2004 1:26 pm 
Newbie

Joined: Fri Mar 26, 2004 8:41 am
Posts: 9
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?


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.