|
Home > Archive > Apache JDO Project > June 2007 > Ease of use for annotations
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Ease of use for annotations
|
|
| Craig L Russell 2007-06-29, 7:11 pm |
| | |
| Andy Jefferson 2007-06-30, 7:11 am |
| > It would be nice if we could have @Column("DEPARTMENT") instead of=20
> @Column(name=3D"DEPARTMENT").=20
I've no particular problem with that but would point out that when you need=
to=20
specify more than just the column name you would have
@Column(value=3D"DEPARTMENT" jdbc-type=3D"BLOB")
i.e "value" and not "name" (and "name" is more logical when doing that)
> Also @Field (column=3D"DEPARTMENT")
I've no problem with adding that shortcut String property to @Field but wou=
ld=20
mention that several shortcuts were removed from non-ORM annotations to try=
=20
to keep a clean divide between JDO and ORM.
On a related subject, previous discussion of @Table, @SecondaryTable,=20
@JoinTable mentioned why is the table name "table" and not "name". I've=20
absolutely no problem with it being "name" (and would make JDO2.1 annotatio=
ns=20
consistent with JPA1 in this respect). If contemplating the change above fo=
r=20
@Column, maybe you're also thinking of
@Table("MYTABLE")
which would mean the annotation property for the table name would be "value=
".
It would be nice to get these into Apache JDO SVN by early next week if at =
all=20
possible since I want to get the next JPOX 1.2 beta out using them
=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)
| |
| Craig L Russell 2007-06-30, 7:11 pm |
| | |
| Andy Jefferson 2007-06-30, 7:11 pm |
| Hi Craig,
> 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".
I was thinking of the same thing :-)
Can't see why that should be controversial (and would only require an extra=
=20
keyword allowing on the definition of the annotation to define which elemen=
t=20
is the default). Leaving out the ability (in JDK1.5) to have a null element=
=20
default value is far more controversial IMHO, or not allowing inherited=20
annotations, or not allowing cyclic annotations, or ...
>
> Could you possibly expand more on this?
OK, in the XML metadata some elements have a String shortcut for something=
=20
that could be specified in a sub-element, but allows the shortcut where the=
=20
user just wants the primary thing ... like name of the column rather than=20
adding <column>. Maybe I was thinking there were more than there actually=20
are. The ones I now see having a quick compare of the DTD and the annotatio=
ns=20
are :-
<field> has "delete-action", yet no "delete-action" annotation element.
<field> has "indexed", yet no "indexed" annotation element.
<field> has "unique", yet no "unique" annotation element.
=20[vbcol=seagreen]
[vbcol=seagreen]
> Ah, deadlines. I'll see how much I can do in the next few days to wrap=20
> things up.=20
Thx
=2D-=20
Andy =A0(Java Persistent Objects - http://www.jpox.org)
|
|
|
|
|