-->
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: projection and collection
PostPosted: Thu Dec 16, 2004 4:40 pm 
Beginner
Beginner

Joined: Tue Jun 22, 2004 3:16 pm
Posts: 35
Hibernate version:2.1.2

I am using Projection select clause but I am having trouble to retrieve a collection. For example, class A has a Set of class B:

class A {

.......

Set b;
public Set getB() {
return b;
}

pulbic void setB(Set b) {
this.b = b;
}

If I do:

select a.id, a.name, a.b from A a where a.id = 123

It gives error:

net.sf.hibernate.QueryException: expecting 'elements' or 'indices' after: id [

Please help!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 16, 2004 4:56 pm 
Beginner
Beginner

Joined: Wed Nov 19, 2003 6:46 pm
Posts: 41
Location: Auckland, New Zealand
RTM, but try:

select a.id, a.name, elements(a.b) from A a where a.id = 123


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.