db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Issue 160: Missing description of index, unique
Date Tue, 14 Feb 2006 21:57:13 GMT
Hi Andy,

Here's a proposal for review.

I can't see the value in having the table attribute for embedded  
index or unique elements. But if they are defined at the class or  
interface level, the table would be used to identify an index or  
unique constraint on an associated table (secondary table).

<proposed addition to 18.13>
ELEMENT index
The index element specifies characteristics of an index associated  
with the containing interface, property, class, join, version,  
discriminator, field, key, value, element, or order.
To specify that there is an index associated with the containing  
element, without specifying the name of the index, the indexed  
attribute can be used instead of the index element. Alternatively,  
the index element with no attributes can be used.
If the index element is specified at the class or interface level,  
then column, field, or property elements contained in the index  
element might contain only the name attribute. If the index element  
is specified in the property, join, version, discriminator, field,  
key, value, element or order, then there must not be any contained  
column, field, or property elements in the index elements.
ATTRIBUTE name
The name attribute specifies the name of the index to generate for  
this mapping. This attribute is used if the name of the index needs  
to be specified.
ATTRIBUTE unique
The unique attribute specifies that the index is unique.
ATTRIBUTE table
The table attribute specifies the name of the table to which the  
index applies. This attribute can only be used with index elements  
defined at the class or interface level.

ELEMENT unique
The unique element specifies characteristics of a unique constraint  
associated with the containing interface, class, property, join,  
version, discriminator, field, key, value, or element.
To specify that there is a unique constraint associated with the  
containing element, without specifying the name of the unique  
constraint, the unique attribute can be used instead of the unique  
element. Alternatively, the unique element can be used with no  
attributes or contained elements.
If this element is specified at the class level, then column elements  
contained in the unique element might contain only the name attribute.
ATTRIBUTE deferred
The deferred attribute specifies whether constraint checking on the  
containing element is defined in the database as being deferred until  
commit. This allows an optimization by the JDO implementation, and  
might allow certain operations to succeed where they would normally  
fail. For example, to exchange unique references between pairs of  
objects requires that the unique constraint columns temporarily  
contain duplicate values.
Possible values are “true” and “false”. The default is “false”.
ATTRIBUTE name
The name attribute specifies the name of the unique constraint to  
generate for this mapping. This attribute is used if the name of the  
unique constraint needs to be specified.
ATTRIBUTE table
The table attribute specifies the name of the table to which the  
unique constraint applies. This attribute can only be used with  
unique elements defined at the class or interface level.

<proposed addition to 18.13>

Craig

On Feb 14, 2006, at 1:14 AM, Andy Jefferson wrote:

> Hi Craig,
>
>> At http://access1.sun.com/jdo/private/index.html
>
> I sent a mail to the jdo-dev list (and also the JDO2 EG) back on  
> Monday 16
> Jan, entitled "Section 18 : Where is <unique>, <index>
> description ?" (viewable from the archive of the jdo-dev mailing  
> list, though
> not for the JDO2 EG archive since that was dead for 3 months).
>
> http://mail-archives.apache.org/mod_mbox/db-jdo-dev/200601.mbox/% 
> 3c200601161712.08972.andy@jpox.org%3e
>
> I don't see anything in the spec for this. Would it be a quick job  
> to get this
> included ?
>
>
> Thanks
> -- 
> Andy
> Java Persistent Objects - JPOX

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