openjpa-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "CASERO Jaime" <JCas...@covansys.com>
Subject RE: Collection field part of a compound primary key
Date Thu, 19 Jul 2007 16:28:35 GMT
Find attached the Holiday classes. Holiday is formed by several
HolidayElements. A HolidayElement is mainly identified by its date, but
several HolidayElement can share the same date if they are from
diffetent Holidays. Here the primary Key is formed by the date and the
Holiday id (which is a foreign key to Holiday). 

	I can't even set the "Id" annotation to a collection field (i'm
using a orm.xml file for metadata).

	Thnaks in adavance 

-----Original Message-----
From: Craig.Russell@Sun.COM [mailto:Craig.Russell@Sun.COM] 
Sent: Thursday, July 19, 2007 6:15 PM
To: users@openjpa.apache.org
Cc: ALONSO Fernando
Subject: Re: Collection field part of a compound primary key

Hi,

Could you please be more specific as to what you tried? I'm a bit  
confused as to whether you're talking about a ToOne relationship or a  
ToMany relationship being used as part of a primary key.

It would help if you would post your class (just the id fields would  
be fine) and the id class you tried.

THanks,

Craig

On Jul 19, 2007, at 6:04 AM, CASERO Jaime wrote:

> Hello all,
>
>             I'm wondering if OpenJPA supports the creation of a  
> compound
> primary key formed by a basic field, and a collection. I have tried
> using an "Id class", and using "unique-constraint", but without any
> results.
>
>
>
>             I think this is a very basic feature (A foreign key is  
> part
> of the primary key) used frequently in any relational data model.
>
>
>
>             Can anyone confirm this feature support?. Any simple  
> example
> would be very appreciated.
>
>
>
>             Thanks in advance, regards.
>
>
>
> Jaime Casero
>
> Confidentiality Statement:
>
> This message is intended only for the individual or entity to which  
> it is addressed. It may contain privileged, confidential  
> information which is exempt from disclosure under applicable laws.  
> If you are not the intended recipient, please note that you are  
> strictly prohibited from disseminating or distributing this  
> information (other than to the intended recipient) or copying this  
> information. If you have received this communication in error,  
> please notify us immediately by return email.
> -----------------------------

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!
 
Confidentiality Statement:
 
This message is intended only for the individual or entity to which it is addressed. It may
contain privileged, confidential information which is exempt from disclosure under applicable
laws. If you are not the intended recipient, please note that you are strictly prohibited
from disseminating or distributing this information (other than to the intended recipient)
or copying this information. If you have received this communication in error, please notify
us immediately by return email.
-----------------------------

Mime
  • Unnamed multipart/mixed (inline, 7-Bit, 0 bytes)
View raw message