I have two tables, A & B, along with their association table, A_B. Table A_B has extra properties in it, so I'm using a composite-element to take care of those.
However, one of those extra properties is an integer array (in the Java object). I've tried to nest a set or an array within the composite-element, something like this:
Code:
<set name="ab" table="A_B" lazy="false" inverse="false" cascade="none" sort="unsorted">
<key column="A_id"/>
<composite-element class="org.A_B">
<property name="name"/>
<set name="intArray" lazy="false" inverse="false" cascade="all" sort="unsorted">
<key column="ABLink_id"/>
<one-to-many class="something"/>
</set>
<many-to-one name="B" class="org.B" cascade="none" outer-join="auto" update="true" insert="true" column="B_id"/>
</composite-element>
</set>
But hibernate doesn't like that. It gives the following error:
Code:
org.xml.sax.SAXParseException: The content of element type "composite-element" must match "(parent?,(property|many-to-one|nested-composite-element)*)".
I realize that with the example I've given, I couldn't exactly use an int - it would have to be some other kind of object. That's a lesser problem.
Any ideas on how I can get the array into the composite element? Or another way I could handle it?