FetchPlan fetch = OpenJPAPersistence.cast(query).getFetchPlan();
fetch.setMaxFetchDepth(15);
fetch.addField(State.class, "incomingTransitions");
fetch.addField(State.class, "outgoingTransitions");
fetch.addField(Transition.class, "toState");
fetch.addField(Transition.class, "fromState");
State qs1 = (State) query.setParameter("name", "s1").getSingleResult();
em.close(); // will not load anything anymore
byte[][] actualTransitionMatrix = new byte[5][5];