-->
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.  [ 3 posts ] 
Author Message
 Post subject: select new ... - problem
PostPosted: Thu Jul 06, 2006 4:36 am 
Newbie

Joined: Thu Jul 06, 2006 4:25 am
Posts: 3
Location: Poland
I have H 3.1.3 and i need to make something like this :

query = tx.getSession().createQuery(
"select new com.comarch.wfm.dao.wrappers.ResourceAdmListWrapper(r, :day, :tx) " +
"from ResourceVO r ");
query.setParameter("resource", resource);
query.setParameter("day", day);
query.setParameter("tx", tx);

now i get exeption : Unable to locate appropriate constructor on class...

An alternative is : creating a list of ResourceVO ,iterating all ResourceVOs and create ResourceAdmListWrapper in loop;

is any possible way to create object in HQL with call a constructrors attribure as a HQL parameter ?

Acure


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 5:33 am 
Expert
Expert

Joined: Tue Dec 28, 2004 7:02 am
Posts: 573
Location: Toulouse, France
Has already your ResourceAdmListWrapper object a constructor with three parameters ? (r, :day, :tx)

_________________
Baptiste
PS : please don't forget to give credits below if you found this answer useful :)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 06, 2006 5:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
i don't think this works. The input can only be something returned from the query.

You can use 3.2 setResultTransformer to handle this though.

_________________
Max
Don't forget to rate


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.