db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Craig L Russell <Craig.Russ...@Sun.COM>
Subject Re: Ease of use for annotations
Date Sat, 30 Jun 2007 19:28:55 GMT
Hi Andy,

On Jun 29, 2007, at 11:58 PM, Andy Jefferson wrote:

>> It would be nice if we could have @Column("DEPARTMENT") instead of
>> @Column(name="DEPARTMENT").
>
> I've no particular problem with that but would point out that when  
> you need to
> specify more than just the column name you would have
> @Column(value="DEPARTMENT" jdbc-type="BLOB")
> i.e "value" and not "name" (and "name" is more logical when doing  
> that)

I agree.

This might be controversial, but my Annotations Feature Request #3 is  
to allow the annotation to declare which element is the default if  
there is only one value specified. In this case, it would be "name".

Without this feature request, we would define two elements: value()  
and name(). Your annotation processor would have to scold you if you  
specified both name and value; only one is allowed. That way, you  
could have both

@Column("DEPARTMENT") and
@Column(name="DEPARTMENT", jdbc-type="DECIMAL(12,0)")
>
>> Also @Field (column="DEPARTMENT")
>
> I've no problem with adding that shortcut String property to @Field  
> but would
> mention that several shortcuts were removed from non-ORM  
> annotations to try
> to keep a clean divide between JDO and ORM.

Could you possibly expand more on this?
>
> On a related subject, previous discussion of @Table, @SecondaryTable,
> @JoinTable mentioned why is the table name "table" and not "name".  
> I've
> absolutely no problem with it being "name" (and would make JDO2.1  
> annotations
> consistent with JPA1 in this respect). If contemplating the change  
> above for
> @Column, maybe you're also thinking of
> @Table("MYTABLE")
> which would mean the annotation property for the table name would  
> be "value".

And name() as well as value(). See above.
>
> It would be nice to get these into Apache JDO SVN by early next  
> week if at all
> possible since I want to get the next JPOX 1.2 beta out using them

Ah, deadlines. I'll see how much I can do in the next few days to  
wrap things up.

Best,

Craig
>
> -- 
> Andy  (Java Persistent Objects - http://www.jpox.org)

Craig Russell
Architect, Sun Java Enterprise System http://java.sun.com/products/jdo
408 276-5638 mailto:Craig.Russell@sun.com
P.S. A good JDO? O, Gasp!


Mime
View raw message