db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michelle Caisse <Michelle.Cai...@Sun.COM>
Subject Re: tck test status
Date Tue, 24 May 2005 22:04:09 GMT
Hi, Andy,

The orm metadata in svn for the Project class uses a join:

        <class name="Project" table="projects">
            <field name="projid" column="PROJID" primary-key="true"/>
            <field name="name" column="NAME"/>
            <field name="budget" column="BUDGET"/>
            <field name="reviewers" table="project_reviewer">
                <join column="PROJID"/>
                <element column="REVIEWER"/>
            </field>
            <field name="members" table="project_member">
                <join column="PROJID"/>
                <element column="MEMBER"/>
            </field>
        </class>

How would you map the reviewedProjects field in Employees?  This is 
where we use mapped-by:

        <class name="Employee">
            ...
            <field name="reviewedProjects" mapped-by="reviewers"/>
            <field name="projects" mapped-by="members"/>
            ...
        </class>

-- Michelle

Andy Jefferson wrote:

>>Below is a summary four test errors that are responsible for 90 out of a
>>total of 115 errors when running the tck on jpox/derby.  The fourth one
>>listed is a test cleanup problem logged as JIRA JDO-48.  Could the JPOX
>>team please take a look at the others?
>>    
>>
>
>  
>
>>test(org.apache.jdo.tck.query.Cast)javax.jdo.JDOUserException: Field
>>"org.apache.jdo.tck.pc.company.Employee.reviewedProjects" has been
>>defined as "mapped-by" the field
>>"org.apache.jdo.tck.pc.company.Project.reviewers" yet this is of an
>>incorrect type (java.util.Set). The field that is set as the "mapped-by"
>>must be of type "org.apache.jdo.tck.pc.company.Employee"
>>    
>>
>
>Well you have a MetaData specification that has a "mapped-by" that points to a 
>Set object in the other class. Is this to represent a M-N or 1-N 
>relationship ? I see nothing in the JDO 2 spec that defines the metadata for 
>M-N relationships. Would be nice if the spec included a definition of what 
>implementations are supposed to accept because without it, it is left open to 
>interpretation, which is a bad thing.
>
>JPOX requires that any mapped-by field is of the type of the class that it is 
>defined in. 
>
>With 1-N :-
>class A
>{
>    Set b;
>}
>class B
>{
>    A a;
>}
>You define the metadata for A field b to have a mapped-by as "a".
>
>
>With a M-N :-
>class A
>{
>    Set b;
>}
>class B
>{
>    Set b;
>}
>With JPOX currently you don't use mapped-by, and you use <join/> because for a 
>M-N you need a join. I see no <join> in the SVN metadata.
>
>HTH
>--
>Andy
>JPOX - Java Persistent Objects
>  
>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message