-->
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: How to query join table collection elements?
PostPosted: Sun Jul 20, 2008 8:44 am 
Newbie

Joined: Sun Jul 20, 2008 8:33 am
Posts: 1
I have an entity object A that has a many-to-one relationship with object B with A having a list of collectionelement join-table C object and C object has a reference back to its parent (A and a many-to-one reference to entity B. My question is how do I generate a query to get A.user or A.list<C> given a primary key id?

@Entity
class A {
@ManyToOne
private B b;

@CollectionOfElements
@JoinTable
private List<C>
}

@Entity
class B {
// no reference to either B or C
}


@Embeddable
class C {
@Parent
private A a;

@ManyToOne
private B

private String name;
}



Thanks!


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.