db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-403) JDO2 Annotations
Date Wed, 04 Jul 2007 00:24:04 GMT

    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510029

Craig Russell commented on JDO-403:

Regarding the fkpk patch, and thinking out loud:

Looking at the rationale for the index, unique, foreign key, and primary key xml attributes
and elements, we want to be able to take the column(s) already defined by the annotation and
define constraints to those columns in the database. The constraints have a name (or an ugly
generated system name), a set of columns, uniqueness, indexiness, and delete and update actions.
All of these except name can already be specified using elements unique(), columns(), indexed(),
deleteAction, and updateAction. 

So the only thing left is the name of the constraint. Maybe all we need to add is the indexName,
uniqueName, or foreignKeyName. Since unique constraints use indexes, we might not need both
uniqueName and indexName. Similarly, if you use foreignKeyName you don't need the other names.
We might just say constraintName and be done with it.

If you have an @Element that you want to define a foreign key on, you specify your deleteAction
and all you need now is the name, say foreignKeyName. 
@Element(foreignKeyName="FKUNIT", deleteAction=ForeignKeyAction.RESTRICT)

Or you have a @Key that is indexed and you want to specify the indexName. Specifying an index
name implies indexed true.

If you have a @Value that is unique and you want to specify the unique constraint name. 
So here are the proposed changes:

1. Add foreignKeyName(), uniqueName(), and indexName() to @Element, @Key, and @Value.
2. Add primaryKeyName(), foreignKeyName(), uniqueName(), and indexName() to @Join.

1. Add constraintName() to @Element, @Key, @Value, and @Join.

> JDO2 Annotations
> ----------------
>                 Key: JDO-403
>                 URL: https://issues.apache.org/jira/browse/JDO-403
>             Project: JDO
>          Issue Type: New Feature
>          Components: api2
>    Affects Versions: JDO 2 final
>            Reporter: Andy Jefferson
>            Assignee: Michelle Caisse
>             Fix For: JDO 2 maintenance release 1
>         Attachments: embedded.patch, embedded.patch, fkpk.patch, jdo_2_1_annotations.jar
> It would be desirable for JDO2 to have its own set of annotations. We have developed
a set within JPOX that would likely serve as a starting point for such a set. In my opinion
they should be
> 1. Split into javax.jdo.annotations.jdo and javax.jdo.annotations.orm
> 2. Move ORM attributes from some of the JDO annotations and have a ORM annotation.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message