Hi There
I would like to know if Criteria objects can operate on collection of type Map
using hibernate 3.2
i have the following relation
table a - mapped with many-to-many to table b.
the lookup table C in the middle contains some more columns
this is the mapping
Code:
<hibernate-mapping package="test"
default-lazy="false">
<class name="A" table="A">
<cache usage="read-write" />
<id name="id" column="ID">
<generator class="sequence">
<param name="sequence">SEQ_A</param>
</generator>
</id>
<map name="mapProp" table="C" cascade="save-update">
<key column="ID_A"/>
<map-key-many-to-many class="B" column="ID_B"/>
<composite-element class="MapProp">
<property name="propA" column="PROP_A"/>
<property name="propB" column="PROP_B"/>
</composite-element>
</map>
</class>
</hibernate-mapping>
<hibernate-mapping package="test"
default-lazy="false">
<class name="B" table="B">
<cache usage="read-write" />
<id name="id" column="ID">
<generator class="sequence">
<param name="sequence">SEQ_B</param>
</generator>
</id>
<set name="A" inverse="true" cascade="none"
table="C" lazy="true">
<key column="ID_B" />
<many-to-many class="A" column="ID_A" />
</set>
</class>
</hibernate-mapping>
I wish to execute the following statement using a criteria:
select ID from A where ID in (select ID_A from C where PROP_A = myInput)
the criteria might have restrictions relevant to table A only
that is the criteria is created the following way (up to now)
Code:
session.createCriteria(A.class);