openjpa-users mailing list archives

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


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.

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


Kindly someone help me on the same. Account.txt Transactions.txt 


Anshuk Pal Chaudhuri
View this message in context:
Sent from the OpenJPA Users mailing list archive at

View raw message