Jump to: navigation, search


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

            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

            attributes={"firstName", "lastName", "salary", "gender"},
public class Employee {
@FetchGroup(name="addr-fg1", attributes={"city"})
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.