Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] Problem with Query: MEMBER OF with more than one Object?

Hi!

I'm trying to get a Query like this working:

List cmpList = <an Array List of the components>

Query q  = em.createQuery("SELECT v FROM Vendingmachine v WHERE :components
MEMBER OF v.components");
q.setParameter("components", cmpList);

(v.components is a Many-To-One List of VendingmachineComponents)


This doesn't work at all. What i need to do, is to search for all
Vendingmachines which contain any of the Components listed in the ArrayList
cmpList.

I know i could first build my cmpList and then do the above query for every
Component to get every corresponding vendingmachine but this seems a little
bit cumbersome (would generate a hughe amount of sql-queries) to me.

What is the most elegant way to achieve my goal?

Thanks in advance for your help!

Best regards,
christian reiter

-- 
View this message in context: http://www.nabble.com/Problem-with-Query%3A-MEMBER-OF-with-more-than-one-Object--tp22078655p22078655.html
Sent from the EclipseLink - Users mailing list archive at Nabble.com.



Back to the top