db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <e...@jpox.org>
Subject RE: Issue 119: cannot add a constraint to a join table
Date Sun, 29 May 2005 19:47:19 GMT
It's supported under class elements, but IMO it's cleaner and straight
forward to set the constraints and whatever related inside the
associations <join>.

The declaration under class implies that we always have cardinality
greater than 1 for any element, like primary-key.

<class table="PERSON">
<primary-key table="PERSON">
...
</primary-key>
<primary-key table="PERSON_DEPT">
...
</primary-key>
...

It doesn't look good to me, and more, we can set primary-key or other
constraints for any table wherever we are.

<class table="APPLE">
<primary-key table="PERSON">
...
</primary-key>
<primary-key table="PERSON_DEPT">
...
</primary-key>
...

Erik Bengtson 

-----Original Message-----
From: Craig Russell [mailto:Craig.Russell@Sun.COM] 
Sent: Sunday, May 29, 2005 9:09 PM
To: Abe White
Cc: JDO Expert Group; jdo-dev@db.apache.org
Subject: Re: Issue 119: cannot add a constraint to a join table

Hi Abe,

Learn something every day.

So in order to define a primary key constraint on a join table, I'll 
have to amend my primary-key proposal to include multiple column 
elements and name= and table= attributes.

Thanks,

Craig

On May 29, 2005, at 11:56 AM, Abe White wrote:

>> Sorry, Abe, I should have reiterated the subject in the text. I'm 
>> talking about the fact that you cannot define constraints for join 
>> tables and tables used to contain Map and List fields. It's possible 
>> to define constraints on mapped columns of classes.
>
> Sure you can.  That's why the class-level constraint element have a 
> "table" attribute.
>
>
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!


Mime
View raw message