You are viewing a plain text version of this content. The canonical link for it is here.
Posted to ojb-user@db.apache.org by Stephen Ting <st...@shinyang.com.my> on 2003/05/27 06:02:42 UTC

Model --> Persistence question

I have some model --> persistence design questions? 
 
The domain model is as follow
 
1. Receiving
2. ReceivinItem
3. Item
 
The relationship of the 3 object are:
 
Receiving
---1----------------1:N---ReceivingItem---0:1---------------------1---It
em
 
 
Receiving object attributes
1. receivingId (pk)
2. List of ReceivingItem object
 
ReceivingItem object attributes
1. Item object
2. itemSpecification
 
Item object attributes
1. itemId (pk)
2. itemDescription
3. qty
4. value
 
My first thought is to inherit class ReceivingItem from Item. I have try
and it's work using OJB. Now if i don't want to do inheritance, but to
create a ReceivingItem object compose of Item object. How should i do it
in OJB? 
 
The attributes of Receiving object will persist to a table and the
attributes of ReceivingItem and Item objects will persist to another
table. 
 
any help are very much appreciated.
 
Thanks,
Stephen