-->
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: Query Using a Set
PostPosted: Fri Oct 15, 2010 8:44 pm 
Newbie

Joined: Sun Oct 10, 2010 1:29 pm
Posts: 2
I have a class that has a set with the following properties:
Code:
    <set name="students" table="usersStudents">
      <key column="userId"/>
      <element column="student" type="string"/>
    </set>


I want to be able to query based on this set of data with a query like:

List l = session.createQuery("FROM User WHERE students = ?").setString(0, studentNumber).list();

Where basically I want to return all the records that have a specific "student" number in the set. What am I doing wrong what if the syntax for my where statement?

Thanks, I am new to hibernate, so please be gentle.

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.