-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: Dodgy old legacy SQL tables simple Advice needed (please)
PostPosted: Thu Jun 15, 2006 7:00 am 
Newbie

Joined: Thu Jun 15, 2006 6:46 am
Posts: 5
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...


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.