use of com.querydsl.jdo.test.domain.QStore in project querydsl by querydsl.
the class FetchPlanTest method listStores.
@SuppressWarnings("unchecked")
@Test
public void listStores() throws Exception {
QStore store = QStore.store;
query = query();
query.from(store).addFetchGroup("products").select(store).fetch();
Field queriesField = AbstractJDOQuery.class.getDeclaredField("queries");
queriesField.setAccessible(true);
List<Query> queries = (List<Query>) queriesField.get(query);
Query jdoQuery = queries.get(0);
assertEquals(new HashSet<String>(Arrays.asList("products")), jdoQuery.getFetchPlan().getGroups());
assertEquals(1, jdoQuery.getFetchPlan().getMaxFetchDepth());
}