You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Andy Jefferson (JIRA)" <ji...@apache.org> on 2006/07/27 12:15:13 UTC

[jira] Created: (JDO-403) JDO2 Annotations

JDO2 Annotations
----------------

                 Key: JDO-403
                 URL: http://issues.apache.org/jira/browse/JDO-403
             Project: JDO
          Issue Type: New Feature
          Components: api20
    Affects Versions: JDO 2 final
            Reporter: Andy Jefferson
             Fix For: JDO 2 maintenance release 1
         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michelle Caisse updated JDO-403:
--------------------------------

    Attachment: fkpk.patch

Attached patch ftpk.patch implements the hack for handling primary and foreign keys.

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508010 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

Regarding the primary key, foreign key problem, how about defining elements in Join, Element, Key, and Value that are arrays of PrimaryKey ( for Join and Element) and ForeignKey defaulting to empty array? Not correct, but the syntax is the same and it works.

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506634 ] 

Craig Russell commented on JDO-403:
-----------------------------------

> On the JPOX annotations doc page http://www.jpox.org/docs/1_2/jdo/annotations.html, the examples for Table, JoinTable, and Secondary table all use name="tablename", but the actual attribute is table. Maybe this is just a bug in the doc, but maybe it really would be better to call the attribute name as with @Column(name="columnname"), @Query(name="queryname"), and many others.

I like the idea of using the name element for the name of the annotation. So for Table, I think name is better. I'm still working through the join and secondary table issues since these are not straightforward mappings from the xml. 

> 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: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Ilan Kirsh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465524 ] 

Ilan Kirsh commented on JDO-403:
--------------------------------

Maybe only @Transactional is needed. @Field will actually indicate @Persistent and persistenceModifier  can be removed.

Also embeddedOnly can be removed from @PersistenceCapable, because when embeddedOnly=true, all the other attributes in @PersistenceCapable are irrelevant, so @EmbeddedOnly is always preferred.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: tck2b.patch
                tck2a.patch

Updated patches for tck2 project for migration of table names etc.

> 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: api2_property_table.patch, embedded.patch, embedded.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506254 ] 

Craig Russell commented on JDO-403:
-----------------------------------

Adding notes to track email discussion:

Proposal: Change
 
DiscriminatorStrategyType to DiscriminatorStrategy
IdentityTypeValue to IdentityType
InheritanceStrategyType to InheritanceStrategy
VersionStrategyType to VersionStrategy



> 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: 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: jdo_2_1_annotations.jar

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: jdo_2_1_annotations.jar

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: annotations.jar

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment:     (was: tck2a.patch)

> 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: api2_property_table.patch, 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment:     (was: tck2b.patch)

> 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: api2_property_table.patch, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509731 ] 

Craig Russell commented on JDO-403:
-----------------------------------

One point to clarify regarding table, catalog, schema.

With xml metadata, table, catalog, and schema appear together in the jdo, package, class and interface elements. This allows the table to be defined using an arbitrary schema and catalog. 

But then, table appears without catalog and schema in property, field, join, key, value, element, index, and unique. This would imply that the table referenced by these elements must be in the same catalog and schema as the corresponding class or interface in which they are embedded. 

If catalog and schema are not specified, the table name itself is [[[database.] catalog.] schema.] table. 

Looking at annotations, we have @Table, @SecondaryTable, @JoinTable with nothing in them save their name, catalog, and schema. I'm wondering what these annotations are for?

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505984 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

On the JPOX annotations doc page http://www.jpox.org/docs/1_2/jdo/annotations.html, the examples for Table, JoinTable, and Secondary table all use name="tablename", but the actual attribute is table. Maybe this is just a bug in the doc, but maybe it really would be better to call the attribute name as with @Column(name="columnname"), @Query(name="queryname"), and many others. 

> 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: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507561 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Re: ForeignKey under Element. Please see my comment of 26 Apr "There is a user requirement to add ForeignKey, PrimaryKey". The limitations in Annotations mean that this is non-obvious how to do it.

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ 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.
@Key(indexName="IXFOO")

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.

Or,
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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505305 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

Thanks for pointing this out.  I filed JDO-501 to fix the manifest.

> 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: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508258 ] 

Craig Russell commented on JDO-403:
-----------------------------------

CREATE TABLE DRAWINGS 
{ 
    ... 
    PT_X_1 INT NULL, 
    PT_Y_1 INT NULL, 
    PT_X_2 INT NULL, 
    PT_Y_2 INT NULL, 
    ... 
) class MyDrawing 
{ 
    @Field 
    @Embedded(fields={ 
            @Field(embeddedFieldName="pt1", 
                           columns={@Column(name="PT_1_X"),@Column(name="PT_1_Y")}), 
            @Field(embeddedFieldName="pt2", 
                           columns={@Column(name="PT_2_X"),@Column(name="PT_2_Y")}) 
        }) 
    MyLine line; 
} 

I don't think this mapping works very well. It requires that the implementation use some defaults or guess which field maps to Point.x and which maps to Point.y.

I think we need to use explicit embedded-embedded mapping, so that each embedded field gets its own embedded mapping. Something like this (this doesn't compile, just to stimulate discussion):

) class MyDrawing 
{ 
    @Field 
    @Embedded(fields={ 
            @Field(embeddedFieldName="pt1", 
embeddedFieldMapping=@Embedded(fields={
@Field(embeddedFieldName="x", columns=@Column(name="PT_1_X")), // mapping from x to PT1x
@Field(embeddedFieldName="y", columns=@Column(name="PT_1_Y")) // mapping from y to PT1y
            @Field(embeddedFieldName="pt2", 
embeddedFieldMapping=@Embedded(fields={
@Field(embeddedFieldName="x", columns=@Column(name="PT_2_X")), // mapping from x to PT2x
@Field(embeddedFieldName="y", columns=@Column(name="PT_2_Y")), // mapping from y to PT2y
        }) 
    MyLine line; 
} 

> 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, 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment:     (was: tck2a.patch)

> 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: api2_property_table.patch, embedded.patch, embedded.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507018 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

You have to have an array of Columns because if the implementation is mapping a field to multiple Columns then they are needed. e.g java.awt.Color JPOX maps to 4 cols. How do I embed that and specify the mapping if only one column is available?

Having an array of Columns is not an issue really since with annotations when the user wants to specify a single column they dont have to put the {}. That is
i.e @Embedded(nullIndicatorColumn="SOUND_MANUFACTURER", ownerField="computer",
        fields={
            @Field(embeddedFieldName="manufacturer", columns=@Column(name="SOUND_MANUFACTURER")),
            @Field(embeddedFieldName="type", columns=@Column(name="SOUND_TYPE"))
        })

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505064 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Thx for applying the patch Michelle. Something I hadnt noticed earlier ... the file "api2/../JDO20.MF" needs "javax.jdo.annotations" adding to the export package list.

> 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: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502430 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

In addition to the previous addition, please update the provided Field annotation (in the attached jar) to also include
=====================

    /** Name of the field when this is embedded in another object. */
    String embeddedFieldName() default "";
===================== 

This is for use (only) when the user wants to define the field mapping for embedded fields. To give an example of its usage

@PersistenceCapable
public class Computer
{
    @Field
    @Embedded(nullIndicatorColumn="GRAPHICS_MANUFACTURER", ownerField="computer",
        fields={
            @Field(embeddedFieldName="manufacturer", columns={@Column(name="GRAPHICS_MANUFACTURER")}),
            @Field(embeddedFieldName="type", columns={@Column(name="GRAPHICS_TYPE")})
        })
    private ComputerCard graphicsCard;
}

@PersistenceCapable
public class ComputerCard
{
    @Field
    private String manufacturer;

    @Field
    private int type;
}

so we are defining the mapping of the columns of ComputerCard when persisted into the table for Computer.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Michelle Caisse updated JDO-403:
--------------------------------

    Attachment: embedded.patch

We had trouble with annotations for an embedded field (Address field in Company class). The attached patch adds an EmbeddedField annotation and changes the field method of Embedded to:
    EmbeddedField[] embeddedFields() default {};

An example of usage is:
    @Embedded(nullIndicatorColumn="COUNTRY",
        embeddedFields={
            @EmbeddedField(name="addrid", column=@Column(name="ADDRID")),
            @EmbeddedField(name="street", column=@Column(name="STREET")),
            @EmbeddedField(name="city", column=@Column(name="CITY")),
            @EmbeddedField(name="state", column=@Column(name="STATE")),
            @EmbeddedField(name="zipcode", column=@Column(name="ZIPCODE")),
            @EmbeddedField(name="country", column=@Column(name="COUNTRY"))
    })
    private Address     address;

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509961 ] 

Craig Russell commented on JDO-403:
-----------------------------------

There seems to be a big difference between JPA and JDO in how the catalog and schema are specified for a mapped table.

>As you say, you only have the "table" under <field> so this implies that any join or secondary table is in the same catalog/schema as the owning table. With these annotations the user can actually specify where the join/secondary table is stored.

I read the spec again and in JDO xml, catalog and schema are specified at the class/interface level and the settings are used to specify the catalog and schema for all mappings in the class/interface. A catalog and/or schema can be explicitly specified wherever table is allowed, by using the [[[database.]catalog.]schema.]table notation. So there is no loss of functionality in JDO.

In JPA, catalog and schema are specified at the table level but don't affect the default for other uses within the same mapping. So every time a table is specified, the catalog and schema would be needed even if they are the same as the primary table for the class mapping. The SecondaryTable and JoinTable annotations also specify the join condition and constraints, unlike JDO where this is specified in the Join annotation.

I've reviewed the discussion from 22-Jun and I'd like to get rid of JDO @Table, @JoinTable, and @SecondaryTable. The way they are defined now, they are just a subset of concepts from JPA and don't really sync with the JDO xml either.

The way I'd prefer to see the annotations used is more directly map JDO xml to annotations:
<class name="MyClass" table="MY_TABLE" catalog="MY_CATALOG"> 
equates to 
@PersistenceCapable (table="MY_TABLE", catalog="MY_CATALOG")

<field name="myCollection"> 
<join table="MY_JOIN_TABLE", column="SEC_PK"/>
equates to 
@Field
@Join(table="MY_JOIN_TBL", column="SEC_PK") 

<field name="myFld" table="MY_SEC_TBL"> 
equates to 
@Field (table="MY_SEC_TABLE")



> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510075 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

> We are missing the references to ForeignKey, Index, and Unique on PersistenceCapable

We have @ForeignKeys, @ForeignKey, @Indexes, @Index, @Uniques, @Unique that are specifable at class level. You could add them to @PersistenceCapable but due to readability issues people are VERY unlikely to ever use it - nested annotations are hard enough to read at the best of times, and there is no need when you can put more than 1 annotation against a class.

> 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, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Ilan Kirsh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12474081 ] 

Ilan Kirsh commented on JDO-403:
--------------------------------

The Query and Sequence annotations conflict with JDO interfaces with the same name.
It might be a good idea to avoid such a conflict.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507530 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

Hi Andy,

Could you explain why @JoinTable and @SecondaryTable are needed?  There is no equivalent in the xml metadata. I guess they are used to get table name/schema/catalog information into the annotations. Could we perhaps have a Table element in Join instead? And allow a field target for Table as well as class, as with 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513769 ] 

Craig Russell commented on JDO-403:
-----------------------------------

I notice that @ForeignKey, @Index, and @Unique use String [ ] fields() whereas @Embedded uses Field[ ] fields() as an element.

Should these be different, now that we have added String name() to @Field? Seems they should be consistent.

@Index(fields={
    "field1",
    "field2",
    "field3"})

versus

@Index(fields={
    @Field("field1"),
    @Field("field2"),
    @Field("field3")})

I guess it doesn't matter too much. There isn't any extra information needed from the field for Index, Unique, and ForeignKey...

> 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: annotations.patch, api2_property_table.patch, embedded.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12513642 ] 

Craig Russell commented on JDO-403:
-----------------------------------

svn commit 
Sending        annotations/Column.java
Sending        annotations/Discriminator.java
Sending        annotations/Element.java
Sending        annotations/Embedded.java
Sending        annotations/Extensions.java
Sending        annotations/FetchGroup.java
Sending        annotations/Field.java
Sending        annotations/ForeignKey.java
Sending        annotations/ForeignKeys.java
Sending        annotations/IdGeneratorStrategy.java
Sending        annotations/Implements.java
Sending        annotations/Index.java
Sending        annotations/Indices.java
Sending        annotations/Inheritance.java
Sending        annotations/Join.java
Sending        annotations/Joins.java
Sending        annotations/Key.java
Sending        annotations/NullValue.java
Sending        annotations/Order.java
Sending        annotations/PersistenceAware.java
Sending        annotations/PrimaryKey.java
Sending        annotations/Property.java
Sending        annotations/Queries.java
Sending        annotations/Query.java
Sending        annotations/Serialized.java
Sending        annotations/Transactional.java
Sending        annotations/Transient.java
Sending        annotations/Unique.java
Sending        annotations/Uniques.java
Sending        annotations/Value.java
Sending        annotations/Version.java
Transmitting file data ...............................
Committed revision 557331.


> 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: annotations.patch, api2_property_table.patch, embedded.patch, embedded.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507695 ] 

Craig Russell commented on JDO-403:
-----------------------------------

Andy sez:
> You have to have an array of Columns because if the implementation is mapping a field to multiple Columns then they are needed. e.g java.awt.Color JPOX maps to 4 cols. How do I embed that and specify the mapping if only one column is available? 

Can you give an example of this? As I understand it, if you have an embedded field of type java.awt.Color you would map it to four columns each of which has a field name, e.g. field r, field g, field b, field a. So you only need one column per field in this case. 

But there are other cases where it is useful to map a field to multiple columns.


> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509968 ] 

Craig Russell commented on JDO-403:
-----------------------------------

I just noticed (my bad) that we have a @PersistentInterface annotation that exactly mirrors @PersistenceCapable. 

Would it be a problem to remove @PersistentInterface and use @PersistenceCapable to annotate interfaces?

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466329 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Further updated jar attached.
1. Added @PersistentInterface, and @Property
2. Added @DatastoreIdentity "column" attribute for consistency
3. VersionStrategyType added NONE option for completeness
4. Added @Field "fieldTypes". Maybe could just have this and throw away "fieldType"?
5. Added @Element, @Key, @Value "types". Maybe could just have this and throw away "type"?


> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12503965 ] 

Craig Russell commented on JDO-403:
-----------------------------------

The annotations containing boolean element types are problematic due to the inability of annotations to properly handle the tri-state "true, false, not-specified". Many of the annotation elements are tri-state, e.g. Field defaultFetchGroup. This defaults to true for a specific list of field types, and false for the remaining types. The user can override the default.

With annotations, if you define defaultFetchGroup as a boolean type you must either require the user to specify a value or define a default. The problem is that the annotation processor cannot distinguish between the user specifying a value and the default. So the defaultFetchGroup element is properly defined as String with a default of "".

The issue comes where some of the elements are defined to be boolean and others defined to be String. I think it's confusing for users to have to remember whether they are supposed to type, e.g. @Field(defaultFetchGroup="true") or @Field(defaultFetchGroup=true).

My preference is to define all of the boolean elements as String. Where the xml defines the default as IMPLIED, the default value is ""; and where the xml defines the default as true, the default value is "true". This gives us the best user experience with the small downside of not having compile-time checking of true/false and the requirement to enclose boolean values in quotes, just like xml.

> 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: 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.


[jira] Resolved: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell resolved JDO-403.
-------------------------------

    Resolution: Fixed

> 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: annotations.patch, api2_property_table.patch, embedded.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Ilan Kirsh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465491 ] 

Ilan Kirsh commented on JDO-403:
--------------------------------

After adding @Transient, maybe @Transactional and @Persistent  should also be added and the FieldPersistenceModifier enum + the Field's persistenceModifier attribute should be removed.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Assigned: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell reassigned JDO-403:
---------------------------------

    Assignee: Michelle Caisse

Thanks, Michelle, for volunteering to work on this. Now that the api2 project has been created, the annotations can be checked in.

> 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: 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-403?page=all ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: annotations.jar

Updated annotations jar with split JDO/ORM packages.
Should be much more acceptable to those who originally requested split JDO-ORM annotations. Some feedback from those companies who originally asked for split JDO-ORM annotations (i.e Xcalia and Versant) would be welcomed since without it I can only provide what I think is suitable for all.

> JDO2 Annotations
> ----------------
>
>                 Key: JDO-403
>                 URL: http://issues.apache.org/jira/browse/JDO-403
>             Project: JDO
>          Issue Type: New Feature
>          Components: api20
>    Affects Versions: JDO 2 final
>            Reporter: Andy Jefferson
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Attachment: embedded.patch

This implements the changes for @Field, @PersistenceCapable, and @PersistentInterface per above.

> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507013 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

Good to have the example.  We balked at having to provide an array of @Column when only one element is expected.  We added @EmbeddedField to use in this case so that we could have a column field with only a single value and no default defined because the user is required to supply an entry.

> 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, 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Comment: was deleted

> 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: 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment:     (was: annotations.jar)

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466319 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Just remembered why I had Field.fieldType, Element.type, Key.type, Value.type as String instead of Class. In the JDO2 spec we allow the implementation to support comma-separated sets of possible values (in particular for when the user has a field of type Object with the intention of storing some specific types there, or also with interface fields). We have 2 options to fix this :-
1. Change the attribute back to type String and allow comma-separated like that
2. Add an additional attribute "fieldTypes" ("types" in Element, Key, Value) of type Class[]. With this the user could either set the "type" when using a single class (most common situation), or use the "types" when specifying multiple.

Interface/Property also do not currently have annotations.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12502348 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Please update the provided Field annotation (in the attached jar) to include 
=====================

    /** Column definition(s) for this field. Used for embedded fields. */
    Column[] columns() default {};
=====================

This then means that users can specify embedded column information.
When specifying an embedded field they would use this way.
When specifying a normal field they would use @Columns/@Column at field level, but they could now use this too.

Sorry, not got time to provide an updated jar with this change, and besides the previous jar was attached some 5 months ago.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507700 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Why does <field> accept multiple <column> elements ? because it is possible to map one field to multiple columns in the datastore (ok if you play with Strings, doubles etc then you dont care about this, but lots of people do). Taking the same capability with annotations we can specify a field with @Columns and define multiple columns for it to be persisted into. All I did with the "columns" property of @Field is apply the same idea for embedded fields.

An example, using java.awt.Point :-
@EmbeddedOnly
class MyLine
{
    Point pt1;
    Point pt2;
}

@PersistenceCapable
@Table(name="DRAWINGS")
class MyDrawing
{
    @Field
    @Embedded(fields={
            @Field(embeddedFieldName="pt1",
                           columns={@Column(name="PT_1_X"),@Column(name="PT_1_Y")}),
            @Field(embeddedFieldName="pt2",
                           columns={@Column(name="PT_2_X"),@Column(name="PT_2_Y")})
        })
    MyLine line;
}

So I have 2 fields in the embedded class, and each of those has 2 columns in the table of MyDrawing.
CREATE TABLE DRAWINGS
{
    ...
    PT_X_1 INT NULL,
    PT_Y_1 INT NULL,
    PT_X_2 INT NULL,
    PT_Y_2 INT NULL,
    ...
)

Suppose we could apply the same where the embedded PC has a relation to another PC and that PC uses a composite PK - hence there are more than 1 column forming the FK across to it, so we need to be able to specify multiple columns in the embedded definition

> 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, 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment:     (was: jdo_2_1_annotations.jar)

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465440 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Updated annotations.jar following recent discussions on jdo-dev mailing list.
Includes :
1. javax.jdo.annotations packaging
2. Merged back in to single package due to absence of justification for split packages
3. Added @Serialized, @EmbeddedOnly, @FetchField, @Transient
4. Updated @Index, @Unique, @ForeignKey to default all attributes
5. Removed @Field recursionDepth, indexed, unique attributes
6. Deleted @Collection, @Array, @Map and moved attributes to @Element, @Key, @Value
7. Added NullValue enum so we can check values of that attribute

Hopefully they are pretty close to being included in SVN

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509966 ] 

Craig Russell commented on JDO-403:
-----------------------------------

More specific comments on @Table, @SecondaryTable, @JoinTable...
> Why @JoinTable, @SecondaryTable, @Table ? 
> @Table is the equivalent of <class table="..."> 

It looks like it's more than that but less than the JPA @Table that also includes UniqueConstraints. In JPA, catalog and schema don't specify the default catalog and schema of the mapping the way JDO does.

> @JoinTable is the equivalent of <field table="..."> when the field is a container field 

But then you still need the @Join annotation to specify the join column. Why isn't @Join sufficient?

> @SecondaryTable is the equivalent of <field table="..."> when the field is not a container field 

In JPA, @SecondaryTable is used at the class level if there are multiple secondary tables that can be used. It also specifies the join condition and uniqueness constraints. And it's not clear how to specify the same table name but different catalog names. I don't think this is a good model for JDO.

> They also map directly across to the same annotations in JPA. 

There are enough differences that I don't think JPA is a good model.

> They are not part of @PersistenceCapable, @Field since they are ORM and there was a time when some other vendor requested that ORM annotations be kept separate from non-ORM. 

They are now in the same package and otherwise mixed. 

> @JoinTable, @SecondaryTable have schema/catalog whereas there is no such concept in the XML since it is desirable to be able to specify the catalog/schema that ANY table is in, whether it is primary or secondary or join. 

That's why we allow [[[database.]catalog.]schema.]table and reserve catalog and schema for default settings for class and interface.

> Why not just have @Table at class and field level ? because it is clearer to have the annotations named specific after what they are representing. 

At class level, we can just have table="TABLENAME". I agree we need to think a bit more about field-level table mapping. I'm not completely happy with the xml for field-specific table mapping. 

> We cant have an @Table element in @Join since then users would HAVE TO specify it (back to limitations of default values in annotations). 

No, but you can have table="TABLE_NAME" in join. Which ties back to the xml pretty well. 


> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12504979 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

Checked in the patch provided by Andy + the updates specified by Andy in comments + changed boolean fields in annotation classes to String with default "".  Revision: 547464  


> 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: 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment:     (was: annotations.jar)

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509756 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

I thought I had already explained why @Table, @SecondaryTable, @JoinTable are required (comment on 22/Jun on this JIRA). To reiterate where they are proposed to be used

<class name="MyClass" table="MY_TABLE">
equates to
@PersistenceCapable
@Table(table="MY_TABLE")

<field name="myCollection" table="MY_JOIN_TBL">
equates to
@Field
@JoinTable(table="MY_JOIN_TBL")

<field name="myFld" table="MY_SEC_TBL">
equates to
@Field
@SecondaryTable(table="MY_SEC_TBL")


While we could put elements "table", "catalog", "schema" into @Field the above annotation is far clearer IMHO, it separates ORM from JDO, and it aligns this part of JDO annotations with JPA (which I thought was a goal of JDO2.1)

As you say, you only have the "table" under <field> so this implies that any join or secondary table is in the same catalog/schema as the owning table. With these annotations the user can actually specify where the join/secondary table is stored.

> 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, 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: tck2a.patch

Updated app-id annotations schema table names

> 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: api2_property_table.patch, embedded.patch, embedded.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: api2_property_table.patch

Patch to add table attribute to @Property

> 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: api2_property_table.patch, 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.


Re: [jira] Commented: (JDO-403) JDO2 Annotations

Posted by Michelle Caisse <Mi...@Sun.COM>.
What's the plan for primary key and foreign key constraint names?

-- Michelle

Craig Russell (JIRA) wrote:

>    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509979 ] 
>
>Craig Russell commented on JDO-403:
>-----------------------------------
>
>Ok, I'll prepare a patch that will include adding table to @PC and @Field and removing @PI.
>
>I think we're also close to agreeing on the way to map embedded that changes @Field.embeddedFieldName to @Field.name and allows nested field names
>
>This is adapted from my message last week after the JDO conference call:
>
>class Employee {
>@Column(name="NAME")
>String name;
>@Embedded(nullIndicatorColumn="DESCRIPTION",
>  fields={
>    @Field(name="address.description", column="DESCRIPTION")),
>    @Field(name="address.location.latitude", column="LATITUDE")),
>    @Field(name="address.location.longitude", column="LONGITUDE"))})
>Address address;
>}
>
>We still need a way to annotate a nested embedded null indicator column. In the above example, Address might have a description but null location. To do this, we can add a nullIndicatorColumn to the @Field annotation, e.g.
>
>    @Field(name="address.location", nullIndicatorColumn="LATITUDE")
>
>Summary of proposed changes:
>
>1. Add element String name() to @Field instead of embeddedFieldName to name the field of the embedded mapping.
>2. Allow dotted notation for field names for nested embedded.
>3. Add element String nullIndicatorColumn() to @Field to identify nested embedded null indicator.
>4. Add element String column() to @Field 
>5. Add element String table() to @Field
>6. Remove @PersistentInterface
>7. Add element String table() to @PersistenceCapable
>8. Add element String catalog() to @PersistenceCapable
>9. Add element String schema() to @PersistenceCapable
>
>
>  
>
>>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, 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.
>>    
>>
>
>  
>


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509979 ] 

Craig Russell commented on JDO-403:
-----------------------------------

Ok, I'll prepare a patch that will include adding table to @PC and @Field and removing @PI.

I think we're also close to agreeing on the way to map embedded that changes @Field.embeddedFieldName to @Field.name and allows nested field names

This is adapted from my message last week after the JDO conference call:

class Employee {
@Column(name="NAME")
String name;
@Embedded(nullIndicatorColumn="DESCRIPTION",
  fields={
    @Field(name="address.description", column="DESCRIPTION")),
    @Field(name="address.location.latitude", column="LATITUDE")),
    @Field(name="address.location.longitude", column="LONGITUDE"))})
Address address;
}

We still need a way to annotate a nested embedded null indicator column. In the above example, Address might have a description but null location. To do this, we can add a nullIndicatorColumn to the @Field annotation, e.g.

    @Field(name="address.location", nullIndicatorColumn="LATITUDE")

Summary of proposed changes:

1. Add element String name() to @Field instead of embeddedFieldName to name the field of the embedded mapping.
2. Allow dotted notation for field names for nested embedded.
3. Add element String nullIndicatorColumn() to @Field to identify nested embedded null indicator.
4. Add element String column() to @Field 
5. Add element String table() to @Field
6. Remove @PersistentInterface
7. Add element String table() to @PersistenceCapable
8. Add element String catalog() to @PersistenceCapable
9. Add element String schema() to @PersistenceCapable


> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505445 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

While changing those XXXStrategyType names to XXXStrategy you may also like to change "IdentityTypeValue" to "IdentityType", dropping the "Value" part.

> 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: 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ http://issues.apache.org/jira/browse/JDO-403?page=all ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: annotations.jar

Donated JPOX annotations in the hope that they will be usefull in developing JDO2 annotations

> JDO2 Annotations
> ----------------
>
>                 Key: JDO-403
>                 URL: http://issues.apache.org/jira/browse/JDO-403
>             Project: JDO
>          Issue Type: New Feature
>          Components: api20
>    Affects Versions: JDO 2 final
>            Reporter: Andy Jefferson
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506623 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

I committed changes to the annotation names:

DiscriminatorStrategyType to DiscriminatorStrategy
InheritanceStrategyType to InheritanceStrategy
VersionStrategyType to VersionStrategy 
IdentityTypeValue to IdentityType

> 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: 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andy Jefferson updated JDO-403:
-------------------------------

    Attachment: tck2b.patch
                tck2a.patch

Patches to support the change in API2 to remove @Table, @JoinTable, etc

> 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, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Attachment:     (was: embedded.patch)

> 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: annotations.patch, api2_property_table.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508269 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Hi Craig,
If the issue here is to justify having columns (plural) in @Field (for use by embedded fields) then the example of using an embedded PC with a 1-1 relation to another PC which uses a compound PK is ample justification IMHO (never mind the fact that this is how we would have done it in XML via <embedded>).

If the issue is how we should map non-standard types like java.awt.Point then that really needs its own JIRA since it affects not just annotations but also XML, and not just embedded fields but also any field of that type in a class (going back to my "MyLine" class earlier in the JIRA - how to specify the persistence of that on its own never mind embedded). [A java.awt.Point is not PC and so can't have @Field (or <field>) defining for it without a change to the spec. If we are contemplating doing such a thing then that would have some useful applications in JPOX spatial types persistence support]

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12501998 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Need the ability to specify column information on embedded fields. We currently allow for
@Embedded(field={...}) specifying a set of @Field annotations that are embedded. Unfortunately @Field has no sub-annotation @Column.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12492197 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

There is a user requirement to add ForeignKey, PrimaryKey annotations under Join, Element, Key, Value  as per http://www.jpox.org/servlet/jira/browse/JAVAFIVEPLUGIN-56

The only problem with this is that Java5 annotations dont allow "null" default values setting so it screws up the annotation definition.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12510024 ] 

Craig Russell commented on JDO-403:
-----------------------------------

Regarding the pkfk.patch:

There should not be a PrimaryKey element in element, only in Join.

We are missing the definitions in join, element, key, and value for Index and Unique. These are specified in xml to allow the user to specify the name of the constraint, not just the fact that the constraint exists. 

We are missing the references to ForeignKey, Index, and Unique on PersistenceCapable. These xml elements allow specifying constraints at the class or interface level.


> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507559 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Why @JoinTable, @SecondaryTable, @Table ?
@Table is the equivalent of <class table="...">
@JoinTable is the equivalent of <field table="..."> when the field is a container field
@SecondaryTable is the equivalent of <field table="..."> when the field is not a container field
They also map directly across to the same annotations in JPA. 
They are not part of @PersistenceCapabale, @Field since they are ORM and there was a time when some other vendor requested that ORM annotations be kept separate from non-ORM.
@JoinTable, @SecondaryTable have schema/catalog whereas there is no such concept in the XML since it is desirable to be able to specify the catalog/schema that ANY table is in, whether it is primary or secondary or join.
Why not just have @Table at class and field level ? because it is clearer to have the annotations named specific after what they are representing. 
We cant have an @Table element in @Join since then users would HAVE TO specify it (back to limitations of default values in annotations).

Hope thats clearer :-)

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12506994 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

What is "trouble" ? it would maybe make it easier to understand because I have used embedded fields with annotations with no problem

An example is provided in
http://www.jpox.org/servlet/jira/browse/JAVAFIVEPLUGIN-64

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465796 ] 

Craig Russell commented on JDO-403:
-----------------------------------

Thanks for the contribution, Andy. Please do these things in order to properly track the intellectual property contribution. This needs to be done before I can put the code into the Apache JDO repository.

1) Add the license header to each file as described here :

   http://www.apache.org/legal/src-headers.html

In particular, remove any (C) Copyright notices from the code, or any of your own license headers or statements of ownership that may be in each file.

2) Put a copy of the Apache License (http://www.apache.org/licenses/LICENSE-2.0) into a file called LICENSE in the META-INF directory of the attachment

3) If you want the original (C) Copyright notices to persist somewhere, put a file COPYRIGHT in the root of the tree and put something like

    The following copyright notice(s) were affixed to portions of the
    code with which this file is now or was at one time distributed and
    are placed here unaltered.

    (C) Copyright XXXX Andy Jefferson and others...

As part of the transfer to the repository, this information will be copied into the NOTICE file that we will then distribute as part of the api2 jar files.


> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Attachment:     (was: embedded.patch)

> 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: annotations.patch, api2_property_table.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12507536 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

I'm wondering how to annotate the foreign key constraint names as described in this metadata snippet for the pc.company.Project class:

            <field name="reviewers" table="project_reviewer">
                <join column="PROJID">
                    <foreign-key name="PR_PROJ_FK"/>
                </join>
                <element column="REVIEWER">
                    <foreign-key name="PR_REV_FK"/>
                </element>
            </field>

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12509972 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Re: @Table, @JoinTable, @SecondaryTable - these were only added after (unnamed) commercial vendors asked for ORM annotations splitting out, and subsequently went very quiet when asked whether the updated annotations were to their satisfaction. My only requirement on separating concerns of JDO and ORM annotation features is handled by documentation and education. Consequently I have no problem with you removing them and adding the "table" element of @PersistenceCapable, @Field since I seem to remember having exactly that at the start. Let's just do that now please!


Re: @PersistentInterface - added because we have<class> and <interface> in XML. I have no issue with it being all in one since we have the "class" object and can easily detect if it is an interface that it is specified on. Similarly there is @Field and @Property (with virtually the same elements) to match <field> and <property>

> 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, 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Attachment: annotations.patch

This is a work-in-progress. It's mostly cleanup toward putting the text of each annotation into the specification.

> 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: annotations.patch, api2_property_table.patch, embedded.patch, embedded.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Michelle Caisse (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12505308 ] 

Michelle Caisse commented on JDO-403:
-------------------------------------

At the teleconference, we discussed making the enum class names stylistically consistent by dropping the trailing "Type" part in some of the names.  This would involve the following class name changes:

DiscriminatorStrategyType to DiscriminatorStrategy
InheritanceStrategyType to InheritanceStrategy
VersionStrategyType to VersionStrategy

If there are no objections, I will make this change.

> 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: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508127 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Re: PK, FK I agree with Michelle. It's a hack but probably the best of the options given the significant limitations in the design of JDK1.5's annotations

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12468004 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

For anyone wanting to review the annotations without opening up the jar, you can have a more user-friendly view at 
http://www.jpox.org/docs/1_2/jdo/annotations.html
Split between class-level and field-level and colour coded for "JDO" or "ORM".

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508304 ] 

Craig Russell commented on JDO-403:
-----------------------------------

> If the issue here is to justify having columns (plural) in @Field (for use by embedded fields) then the example of using an embedded PC with a 1-1 relation to another PC which uses a compound PK is ample justification IMHO (never mind the fact that this is how we would have done it in XML via <embedded>). 

I agree that having columns (plural) in @Field is not an issue.

> If the issue is how we should map non-standard types like java.awt.Point then that really needs its own JIRA since it affects not just annotations but also XML, and not just embedded fields but also any field of that type in a class (going back to my "MyLine" class earlier in the JIRA - how to specify the persistence of that on its own never mind embedded). [A java.awt.Point is not PC and so can't have @Field (or <field>) defining for it without a change to the spec. If we are contemplating doing such a thing then that would have some useful applications in JPOX spatial types persistence support]

I think there are two different topics here.

1. I agree that if we're discussing how to map types that are not mentioned in the spec and not able to be enhanced (java.awt.Point) this is a separate issue and we should take it off to another JIRA.

2. I'd like to talk about mapping org.apache.jdo.tck.pc.mylib.PCRect as an embedded field. PCRect includes two PCPoint instances, so you have to map the embedded PCPoint instances as embedded-embedded. I'll take a look at whether the existing xml covers this case, and if so, it's an annotations issue. If not, then it's a functionality issue for the spec and should be discussed in its own JIRA issue.


> 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, 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Attachment:     (was: fkpk.patch)

> 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: annotations.patch, api2_property_table.patch, embedded.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12508309 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

> 2. I'd like to talk about mapping org.apache.jdo.tck.pc.mylib.PCRect as an embedded field. PCRect includes 
> two PCPoint instances, so you have to map the embedded PCPoint instances as embedded-embedded

Agreed - nested embedded PC fields aren't catered for in what was provided, and your example (but using PCRect/PCPoint as nested embedded) demonstrates how it could be done for 1-level of nesting. XML handles this fine since you can have <embedded> within a <field> recursively (down to multiple levels). Annotations have some strange limitation on recursing too (in addition to the other strange limitations), so not sure if you'll be able to get multi-level recursion (like XML supports). Its the same issue we have with @FetchGroup and @FetchField

> 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, 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.


[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Andy Jefferson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465822 ] 

Andy Jefferson commented on JDO-403:
------------------------------------

Just attached an updated jar with :-)
1. License headers as per http://www.apache.org/legal/src-headers.html and the same as existing Apache JDO "api2" code, removing all (C) copyrights. Also added @version and @since consistent with current Apache JDO practice
2. LICENSE file added under META-INF
3. Added @Transactional as per Ilan comments.
4. Removed @DatastoreIdentityColumns, @VersionColumns and moved into @DatastoreIdentiy, @Version so they are consistent with all other annotations.
5. Changed @Sequence "factoryClass" to be Class. Changed @Query "resultClass" to be Class.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Ilan Kirsh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12466402 ] 

Ilan Kirsh commented on JDO-403:
--------------------------------

I guess types only should be fine, because a single type will usually be specified using Java 5.0 generics anyway.

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Commented: (JDO-403) JDO2 Annotations

Posted by "Ilan Kirsh (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12465480 ] 

Ilan Kirsh commented on JDO-403:
--------------------------------

Looks very good. As a result of update #6 maybe the XML metadata should also be extended to support everything in element / key / value XML elements (updating the spec).

> 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
>             Fix For: JDO 2 maintenance release 1
>
>         Attachments: 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.
-
If you think it was sent incorrectly contact one of the administrators: https://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Attachment: embedded.patch

Accidentally removed this patch.

> 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: annotations.patch, api2_property_table.patch, embedded.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.


[jira] Updated: (JDO-403) JDO2 Annotations

Posted by "Craig Russell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JDO-403?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Craig Russell updated JDO-403:
------------------------------

    Attachment: embedded.patch

I've looked at how to map embedded map keys and values, and by changing the embedded() from String to @Embedded[ ] and adding embeddedKey, embeddedValue, and embeddedElement to @Field and @Property, here is some sample code that compiles ok:

    @Field(table="INTEGER_LINES", embeddedKey="true", embeddedValue="true")
    @Join(column="OWNER_FK")
    @Key(column="INTEGER")
    @Value(
        embedded=@Embedded(
            fields={
                @Field(name="point1.x", column="POINT1_X"),
                @Field(name="point1.y", column="POINT2_Y"),
                @Field(name="point2.x", column="POINT2_X"),
                @Field(name="point2.y", column="POINT2_Y")
    }))
    Map<Integer, Line> integerLines;

    @Field (table="LINES", embeddedElement="true")
    @Join(column="OWNER_FK")
    @Element (
        embedded=@Embedded(
            fields={
                @Field(name="point1.x", column="POINT1_X"),
                @Field(name="point1.y", column="POINT2_Y"),
                @Field(name="point2.x", column="POINT2_X"),
                @Field(name="point2.y", column="POINT2_Y")
            }))
    Set<Line> lines;

I think it's pretty true to the xml concepts. What do you think?


> 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: annotations.patch, api2_property_table.patch, embedded.patch, embedded.patch, embedded.patch, fkpk.patch, jdo_2_1_annotations.jar, tck2a.patch, tck2b.patch
>
>
> 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.