Hi,
I'm having trouble figuring out how to map the inverse of an <any> relationship. For example, here is part of the mapping for a Quota object:
Code:
...
<any name="object" id-type="int">
<column name="object_class"/>
<column name="object_id"/>
</any>
...
These quotas can be applied to many different types of objects. Given the quota, I can getObject and to get the object that it is applied to. This works well.
However, I can't figure out how to get the set of quotas for a given object (e.g. User object). If it was not an <any> relationship, I would do something like:
Code:
...
<set name="quotas" inverse="true">
<key column="user_id"/>
<one-to-many class="User"/>
</set>
...
But what do I put in the <key> to show that it refers to the "object_class" and "object_id" of my <any> relationship?