In short: Is it possible to have the two columns of an <any> relationship be a composite key?
More detailed:
When I was looking through the test code, I found this nice little example of how to use a formula and a one-to-one:
Code:
...
<class name="Person">
<id name="name"/>
<one-to-one name="address" cascade="all" constrained="false">
<formula>name</formula>
<formula>'HOME'</formula>
</one-to-one>
<one-to-one name="mailingAddress" constrained="false">
<formula>name</formula>
<formula>'MAILING'</formula>
</one-to-one>
</class>
<class name="Address" batch-size="2"
check="addressType in ('MAILING', 'HOME', 'BUSINESS')">
<composite-id>
<key-many-to-one name="person" column="personName"/>
<key-property name="type" column="addressType"/>
</composite-id>
<property name="street" type="text"/>
<property name="state"/>
<property name="zip"/>
</class>
Is this possible to do with an <any> relationship? Something like (I'm totally making this up):
Code:
<class name="Address">
<composite-id>
<key-property name="type" column="addressType"/>
<key-property name="key" column="addressKey"/>
</composite-id>
<any name="owner" id-type="string" meta-type="string">
<meta-value value="USER" class="org.argyle.core.domain.User"/>
<column name="addressType"/>
<column name="addressKey"/>
</any>
</class>
Thanks!