[ 
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", 
                           [EMAIL 
PROTECTED](name="PT_1_X"),@Column(name="PT_1_Y")}), 
            @Field(embeddedFieldName="pt2", 
                           [EMAIL 
PROTECTED](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", 
[EMAIL PROTECTED](fields={
@Field(embeddedFieldName="x", [EMAIL PROTECTED](name="PT_1_X")), // mapping 
from x to PT1x
@Field(embeddedFieldName="y", [EMAIL PROTECTED](name="PT_1_Y")) // mapping from 
y to PT1y
            @Field(embeddedFieldName="pt2", 
[EMAIL PROTECTED](fields={
@Field(embeddedFieldName="x", [EMAIL PROTECTED](name="PT_2_X")), // mapping 
from x to PT2x
@Field(embeddedFieldName="y", [EMAIL PROTECTED](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.

Reply via email to