-->
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: ejb-ql many-to-many query
PostPosted: Tue Jul 31, 2007 7:17 am 
Regular
Regular

Joined: Sat May 20, 2006 3:49 am
Posts: 78
hi!

I have a question regarding a query for the following tables:

Table A:
A.ID
A.COLUMN1

Table B:
B.ID
B.COLUMN1

Table AB (many-to-many table):
AB.ID
AB.ID_A (references A.ID)
AB.ID_B (references B.ID)
AB.COLUMN1

know I need the following query with ejb-ql:

SELECT A
WHERE A.COLUMN1 = ?1
AND B.COLUMN1 = ?2
AND AB.COLUMN1 = ?3
AND AB.ID_A = A.ID
AND AB.ID_B = B.ID

my pojos all have the sets for the related entities (generated with hibernate tools). this means pojo A has A.getABs(), pojo B has B.getABs(), pojo AB has AB.getAs(), AB.getBs().

can anybody help me with the ejb-ql-query?

regards,
chris.


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.