-->
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.  [ 3 posts ] 
Author Message
 Post subject: Collection or CSV
PostPosted: Fri Jul 09, 2004 9:42 am 
Senior
Senior

Joined: Fri Jun 18, 2004 10:17 am
Posts: 140
Hi Guys

I have a property called owners which is a comma-separated list of Strings representing users.

I wish to load a set of objects from the datbase where a passed username is in this comma separated list.

I can't see anything in the HQL reference for this and I thought a Collection was a bit heavy-handed for this or not?


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 10:46 am 
Hibernate Team
Hibernate Team

Joined: Tue Sep 09, 2003 2:10 pm
Posts: 3246
Location: Passau, Germany
You can probably use some database-specific function in HQL like "select u from Something u where indexof(:username, u.usernames) != -1" - might probably work.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jul 09, 2004 10:47 am 
Senior
Senior

Joined: Fri Jun 18, 2004 10:17 am
Posts: 140
thanks .. i ended up using a Set of strings which worked out really well. Hibernate rocks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.