You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by Craig L Russell <Cr...@Sun.COM> on 2007/07/18 01:37:04 UTC
FetchField cleanup in annotations
Now that we've rationalized the foreign keys, can we take another
look at the FetchField?
We added the field name to Field for embedded. Can we add
recursionDepth as well? Then instead of this:
@FetchGroup(fields={@FetchField(name="line", recursionDepth=2)}
we would have this:
@FetchGroup(fields={@Field(name="line", recursionDepth=2)}
It's a minor point, but I sorta hate to have an additional FetchField
annotation if it isn't needed.
And can we fix the nested FetchGroup problem by adding an element to
FetchGroup:
String[] fetchGroups() default {};
since we use the names of fetch groups elsewhere and only use the
FetchGroup annotation to define the group.
So, proposal:
1. Add recursionDepth to @Field.
2. Remove @FetchField.
3. Change @FetchGroup FetchField[] fields(); to Field[] fields();
4. Add to @FetchGroup String[] fetchGroups() default {};
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!
Re: FetchField cleanup in annotations
Posted by Craig L Russell <Cr...@Sun.COM>.
Just one more observation.
In addition to adding recursionDepth to @Field we should add it to
@Property.
And add Property[ ] properties() default {} to FetchGroup.
That should cover nested FetchGroup and properties as well.
Looking again at <fetch-group> it doesn't look like the intent was
actually to nest fetch-group but to allow references to embedded
fetch-group by name, with the actual definition elsewhere.
Craig
On Jul 17, 2007, at 4:37 PM, Craig L Russell wrote:
> Now that we've rationalized the foreign keys, can we take another
> look at the FetchField?
>
> We added the field name to Field for embedded. Can we add
> recursionDepth as well? Then instead of this:
>
> @FetchGroup(fields={@FetchField(name="line", recursionDepth=2)}
>
> we would have this:
>
> @FetchGroup(fields={@Field(name="line", recursionDepth=2)}
>
> It's a minor point, but I sorta hate to have an additional
> FetchField annotation if it isn't needed.
>
> And can we fix the nested FetchGroup problem by adding an element
> to FetchGroup:
>
> String[] fetchGroups() default {};
>
> since we use the names of fetch groups elsewhere and only use the
> FetchGroup annotation to define the group.
>
> So, proposal:
>
> 1. Add recursionDepth to @Field.
>
> 2. Remove @FetchField.
>
> 3. Change @FetchGroup FetchField[] fields(); to Field[]
> fields();
>
> 4. Add to @FetchGroup String[] fetchGroups() default {};
>
> 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!
>
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!