Jump to: navigation, search

Talk:EclipseLink/Development/Incubator/Extensions/NestedFetchGroup

Annotation & XML support

In bug 211322 support for defining named FetchGroups using annotations and/or XML is being defined. To be sure the nested case is covered I would propose that we could do something like:

Example 1: Specifying Use of Dynamic FG

@FetchGroup(name="emp-fg1", 
            attributes={"firstName", "lastName", "salary", "gender"},
            groups={@FethGroup(name="address", attributes={"city"})})

In example 1 the FetchGroup specified in groups is considered dynamic since it provides a list of attributes. In this case the name will be considered the attribute name on the source object to apply this FG to.

Example 2: Specifying Use of Named FG

@FetchGroup(name="emp-fg2", 
            attributes={"firstName", "lastName", "salary", "gender"},
            groups={@FethGroup(name="addr-fg1")})
@Entity
public class Employee {
...
 
@FetchGroup(name="addr-fg1", attributes={"city"})
@Entity
public class Address {

In example 2 the nested FG has no attributes so the name specified is meant to reference a named FG defined on Address.