-->
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: Subqueries in hql constructors
PostPosted: Thu Oct 27, 2005 10:44 am 
Newbie

Joined: Thu Oct 27, 2005 10:33 am
Posts: 1
I was just wondering if a query looking like this is valid:

Code:
select new UserBean(user.username, user.password, (select friends from FriendBean friend where friend.user.id = id and friend.age>12)) from UserBean user where username='ragnar'


That is, having a new object created with a subquery result as constructor parameter. When I try it, I get

Code:
org.hibernate.hql.ast.QuerySyntaxError: Unable to locate appropriate constructor...


So I'm wondering if this type of query is implemented in hql, and if so, what else could be wrong. (There is indeed a valid and appropriate constructor in UserBean). The query is just an example, so suggested workarounds might not be suitable.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Apr 25, 2006 5:12 pm 
Newbie

Joined: Fri Feb 03, 2006 10:06 pm
Posts: 4
I'm trying to do something similar... has anyone been able to do this?


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.