-->
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: java.sql.Date X java.util.Date in value objects
PostPosted: Fri Apr 22, 2005 2:23 pm 
Newbie

Joined: Fri Mar 26, 2004 9:23 am
Posts: 3
Value object:
...
public class Xxx{
public java.sql.Date data;
public Xxx(java.sql.Date data){
this.data = data;
}
}
...
HQL:
...
select new Xxx(sc.data) from SomeClass sc
...
Exception:

1 errors occurred while listing (and calling getPathNames).
net.sf.hibernate.PropertyNotFoundException: no appropriate constructor in class: Xxx


I'm sure sc.data is a java.sql.Date in the java code and in the mapping files (type=java.sql.Date)... the sql-type is timestamp and the database is Postgres. Writing and reading from the original class (SomeClass) works fine. If I change the the attribute data in Xxx to java.util.Date the HQL works...

Any Ideas ?

Thanks in advance,

Walter


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.