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.  [ 2 posts ] 
Author Message
 Post subject: Timestamp in report query fails-Unable to locate constructor
PostPosted: Tue Jul 19, 2005 2:24 pm 
Newbie

Joined: Fri Jul 08, 2005 6:24 pm
Posts: 3
I am using hibernate 3.0.5.

Problem description follows:

I have the following report query which works fine:

select new NewsRow (news.id, news.title, news.body) from News news

NewsRow is just a DTO object. It has two contructors:

NewsRow(Integer id, String title, String body)

and

NewsRow(Integer id, String title, String body, Timestamp creationTs)

News is a mapped entity. News, among its intance fields, has a creation timestamp value (java.sql.Timestamp) which is mapped to a column in the database.

I modified the report query above to also include the creation timestamp:

select new NewsRow (news.id, news.title, news.body, news.creationTs) from News news

For some reason unknown to me, now it fails with the following error:

org.hibernate.hql.ast.QuerySyntaxError: Unable to locate appropriate constructor on class [NewsRow]. I am not quite sure why I am getting this error since there is a compatible constructor in the NewsRow class (see above).

Is it just that timestamps cannot be used in report queries? I am thinking this cannot be it... has someone run into this problem? Thanks.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jul 19, 2005 2:32 pm 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 12:50 pm
Posts: 5130
Location: Melbourne, Australia
Use java.util.Date. This was discussed many times.


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

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.