Hello,
I've got some problem using the criteria API.
I can't manage to execute this simple SQL statement:
Code:
select *
from A
join A_B ab1 on (ab1.ida = a.id)
join A_B ab2 on (ab2.ida = a.id)
join B on (B.id = ab1.idb)
where ab1.idb = '193609' and ab2.idb = '193662'
The schema have 3 tables
Code:
Table A
id
Table B
id
Table A_B
ida
idb
i have create a mapping with a many-to-many relation like this in the A.hbm.xml file:
Code:
<set name="array" table="A_B">
<key column="ida"/>
<many-to-many column="idb" class="B"/>
</set>
It is possible to manage this query with the criteria API ??
Ludo