-->
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 to match string against object field in collection?
PostPosted: Tue Jan 11, 2005 12:19 pm 
Senior
Senior

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

I have an object O that has a List collection of N. I wish to write a condition into a HQL query that gets me all Os where a string value matches n.aField. The HQL will be run against the whole O table.

My first thought was something like

Code:
select distinct o from O o where ? in elements(n)


but then realised that that will not work because n is of type N and not String.

Your thoughts appreciated.

Hibernate version:
2.1
Mapping documents:
N/A
Code between sessionFactory.openSession() and session.close():
N/A
Full stack trace of any exception that occurs:
N/A
Name and version of the database you are using:
SQL Server 2000
The generated SQL (show_sql=true):
N/A
Debug level Hibernate log excerpt:
N/A


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.