openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Anshuk <Anshuk_Chaudh...@infosys.com>
Subject One to Many relation with custom objects
Date Wed, 26 Nov 2008 04:39:04 GMT

Hi

I need to map custom objects in orm.xml. There is an Account class(attached
the file) that contain attribute account number and transactions objects of
type Transactions class (attached the file).The transactions class in turn
gets and sets a list of Transaction (object). The transaction contains many
attributes (which is fine, not attached the file) and the transactions
entity in the orm.xml has been set as one-to-many which is it shoud be.

The issue is that the account object would have multiple transaction and
that would be eventually set using the set transactions method.

But I am not sure how to map this one-to-many relationship in the orm.xml
for the account entity.
i have mapped accountNumber as < id> in orm.xml. now i need to map
transactions into it. orm schema is not allowing One-to-many inside the
account element.

<attributes>
<id name="accountNumber">
<column name="ACCOUNT_NUMBER" length="20" />
</id>

</attributes>

Kindly someone help me on the same. 
http://n2.nabble.com/file/n1579596/Account.txt Account.txt 
http://n2.nabble.com/file/n1579596/Transactions.txt Transactions.txt 

Thanks.

Regards,
Anshuk Pal Chaudhuri
-- 
View this message in context: http://n2.nabble.com/One-to-Many-relation-with-custom-objects-tp1579596p1579596.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.


Mime
View raw message