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

Reply via email to