db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Geoff hendrey <geoff_hend...@yahoo.com>
Subject Re: Embedded collections of non-PC objects
Date Sun, 17 Jul 2005 19:33:19 GMT
--- Andy Jefferson <andy@jpox.org> wrote:

> Hi Craig,
> 
> thanks for your reply and your insights.
> 
> > > Example 1 : Collection of BigDecimal
> > > 1. Basic collection
> > > <field name="myfield">
> > >     <collection
> element-type="java.math.BigDecimal"/>
> > >     <join/>
> > > </field>
> > > This creates 2 tables - 1 for the class owning
> "myfield", and 1
> > > join table to
> > > contain the elements. If <join> is omitted then
> an error should be
> > > thrown
> > > (though i'm not sure if JPOX currently flags
> this up)
> >
> > The join element has no defaults, so this is not
> sufficient to
> > describe the mapping. You need at least a column
> attribute naming the
> > join column. And you need to name the column in
> the join table to map
> > the BigDecimal values to. So,
> >
> > <field name="myfield" column="VALUES"
> table="MYFIELD_TABLE">
> >      <collection
> element-type="java.math.BigDecimal"/>
> >      <join column="JOIN_COLUMN"/>
> > </field>
> 
> I don't necessarily agree here. We have to qualify
> the statement with the 
> following
> New schema : The JDO impl is perfectly capable of
> providing default namings 
> for columns and perfectly capable of choosing the
> join columns ... since it 
> has the (PK) columns in the main table. It provides
> default namings for 
> columns in other situations. 
> Existing schema : The user should specify the
> columns and table as you stated.

Andy, I totally appreciate that you are trying to
provide your users with good forward mapping tools,
but I agree with Craig. 

Personally I think the approach to forward schema
genration should be to allow the user to start with a
plain .jdo file (no ORM elements). The tool should
then produce a default ORM file that looks as Craig
describes. An empty <join/> element is going to be a
source of confusion.

I've looked at all the examples in your email, and
lined them up with the spec and I agree with Craig's
interpretations. Keep up the good work, and Go JPOX!

-geoff


		
____________________________________________________
Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 

Mime
View raw message