Hello,
Pls let me know about the following requirement :
Example : My system contains Collector , Account , Document, Dispute Entities. Collector manages diff accounts and Accounts is a collection of documents. Now a dispute can be raised against a document/account.
There is a junction table DISPUTE_RELATION for this association. DISPUTE_RELATION contains dispute_relation_id, dispute_id, logical_type, logical_key. logical_type is either COLLECTOR, ACCOUNT, DOCUMENT. and logical_key contains the corresponding IDs.
Now when a dispute is created, a record is created in Dispute Table and three records go into DISPUTE_RELATION table. One for Collector , one for account and one for document. Now I have an issue that how to show this kind of association ?
<class name="com.aceva.rms.dispute.Dispute" table="Dispute">
<id name="id" column="id" type="long" length="15" unsaved-value="null">
<generator class="sequence"/>
</id>
<set name="entityMap" table="dispute_relation">
<key column="dispute_id"/>
<many-to-many column="" class="??????"/>
</set>
Issue is there are diff kinds of objects in this association with dispute, i.e collector, account and document. And these objects have no relation ship between them . And I can show only association with only one kind of object in the junction table??
I hope I am clear. Let me know if any doubts.
Please let me know about this as its urgent. I am in the process of rearhitecturing part of my system on hibernate. And this is the most demanding requirement.
|