I've been using Hibernate in Java and Dot net for a while, on and off... It's the best thing I've found in years...Anyway here's my request for some help:-
I have two tables which are
FeeNotes
pri_key ... sequence primary key
fee_id ... an integer that is assigned to a record
acct_id .. a string that is also assigned to the record
pri_key is unique but not used by the business logic. fee_id and acct_id are only unique together! In other words there can be multiple fee_id, but not for the same acct_id
there are more fields in the feeNotes table but not worth mentioning. Another detail table exists, :-
FeeItems, consist of
pri_key .. a sequence ... primary key only used to update the record but no business purpose, and
acct_id ...string as above
rend_id ..int as above
line_no .. and int to specify a sort order for the items
...various other non interesting field...
I am unsure how to create the xml mapping document for this structure. bearing in mind that the fee_id is manually eet.. I've tried
<list name="Items" table="FeeItems" lazy="false">
<key column="acct_id" />
<index column="fee_id" type="int"/>
<one-to-many class="FeeLine" />
</list>
<class name="FeeLine" table="Feeitems" lazy="false" >
<composite-id unsaved-value="none">
<key-property name="Pk" type="int" column="pri_key"/>
<key-property name="acct_id" type="string" column="ACCT_ID"/>
<key-property name="fee_id" type="int" column="FEE_ID"/>
<key-property name="ItemLine" type="int" column="LINE_NO"/>
</composite-id>
<property name="ItemDesc" type="string" column="ITEM_DESC"/>
:
: etc etc
:
<property name="ItemVal" type="double" column="ITEM_VAL"/>
</class>
I've also tried to use a map, but that didn't work either. Any advice on what I should be looking for use would be greatly appreciated.
Cheers
P
:karma:
_________________ I'm addicted to VBoost...
|