> -----Original Message-----
> From: Bruno Martin [mailto:[email protected]]
> Sent: Sunday, January 10, 2010 11:21 AM
> To: [email protected]
> Subject: How to make a one-sided one-many association without a cross
> table using xml and not annotations
> 
> 
> Hi there,
> 
> I hate annotation, so i want to know how to make a one-sided one-many
> association without a cross table using a persistence.xml file.  The
> example
> given at  http://openjpa.apache.org/faq.html FAQ  show how to do it
> using
> annotations.  Can someone give me the same using xml configuration.

To be clear, I think you should provide the basic structure of your
tables, so we can be sure what you're trying to model.

For instance, if I have table FOO with PK FOO_ID, and a table BAR with
PK BAR_ID and FK FOO_ID, the "one-to-many" association could be
described as:

<entity name="Foo" class="...Foo">
 <attributes>
  <one-to-many name="barList" target-entity="Bar">
    <join-column name="FOO_ID" referenced-column-name="FOO_ID"/>
  </one-to-many>
 </attributes>
</entity>

Reply via email to