Should I be able to remove an eager field from the default fetch plan? For
example, I have the following Entity snippet:

@Entity
public class ManyEagerNode {
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    protected int id;

    @OneToMany(cascade=CascadeType.ALL, fetch=FetchType.EAGER)
    Set<ManyEagerNode> setConnections = new HashSet<ManyEagerNode>();
...
}

and I would like to be able to mark the setConnections field as LAZY. I
thought I should be able to do something along these lines...

FetchPlan fp = em.getFetchPlan()
fp.removeField("org.apache.openjpa.persistence.graph.ManyEagerNode.setConnections");

I browsed the code and it's quite obvious that this will not work. Is this
by design, or an oversight? The docs seem to imply that the fetch plan can
used to mark fields as Eager, but not vice versa. I assume I could create a
new, non-default fetch plan and I could manually add my fields.... but I
would like to work directly with the default fetch plan.

Thoughts?

-- 
*Rick Curtis*

Reply via email to