-->
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: HQL and JoinTable
PostPosted: Tue Jul 20, 2010 10:54 pm 
Newbie

Joined: Wed Jul 07, 2010 8:36 am
Posts: 3
I have the following entity (Question) and a JoinTable with another entity(Topic).

Code:
@Entity()
@SequenceGenerator(name="QUESTION", sequenceName="QUESTION_SEQ", allocationSize=1)
public class Question implements Serializable {
   ...
   @OneToMany
   @JoinTable(
      name="TOPIC_QUESTION",
      joinColumns={@JoinColumn(name="QUESTION_ID")},
      inverseJoinColumns={@JoinColumn(name="TOPIC_ID")}
   )
   private List<Topic> topics = new ArrayList<Topic>();
   ...


I've been trying to create a HQL passing a List of topics and it is not working. In such a case, how'd you write such a query????


thanks in advance
PS: I know there is a few others solutions (besides HQL... e.g. Criteria), but ive wanted a HQL solution


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.