openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bruno Martin <brunomarti...@hotmail.com>
Subject RE: How to make a one-sided one-many association without a cross table using xml and not annotations
Date Sun, 10 Jan 2010 23:41:17 GMT

WOW, Thanks David, you are a PRO !!!

I owe you one for sure.



KARR, DAVID (ATTCINW) wrote:
> 
>> -----Original Message-----
>> From: Bruno Martin [mailto:brunomartin88@hotmail.com]
>> Sent: Sunday, January 10, 2010 11:21 AM
>> To: users@openjpa.apache.org
>> 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>
> 
> 

-- 
View this message in context: http://n2.nabble.com/How-to-make-a-one-sided-one-many-association-without-a-cross-table-using-xml-and-not-annotations-tp4282233p4283081.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Mime
View raw message