@Test public void testCreateRootQuery_ById() { SelectContext<E1> c = new SelectContext<>(E1.class); c.setId(1); c.setEntity(getResourceEntity(E1.class)); SelectQuery<E1> s1 = queryAssembler.createRootQuery(c); assertNotNull(s1); assertSame(E1.class, s1.getRoot()); }
public <T> SelectQuery<T> createRootQuery(SelectContext<T> context) { SelectQuery<T> query = context.getId() != null ? createRootIdQuery(context.getEntity(), context.getId()) : createQuery(context.getEntity()); if (context.getParent() != null) { query.andQualifier(CayenneUtil.parentQualifier(context.getParent(), cayenneEntityResolver)); } return query; }
CayenneQueryAssembler { public <T> SelectQuery<T> createRootQuery(SelectContext<T> context) { SelectQuery<T> query = context.getId() != null ? createRootIdQuery(context.getEntity(), context.getId()) : createQuery(context.getEntity()); if (context.getParent() != null) { query.andQualifier(CayenneUtil.parentQualifier(context.getParent(), cayenneEntityResolver)); } return query; } }
CayenneQueryAssembler { public <T> SelectQuery<T> createRootQuery(SelectContext<T> context) { SelectQuery<T> query = context.getId() != null ? createRootIdQuery(context.getEntity(), context.getId()) : createQuery(context.getEntity()); if (context.getParent() != null) { query.andQualifier(CayenneUtil.parentQualifier(context.getParent(), cayenneEntityResolver)); } return query; } CayenneQueryAssembler(EntityResolver cayenneEntityResolver); }
CayenneQueryAssembler { public <T> SelectQuery<T> createRootQuery(SelectContext<T> context) { SelectQuery<T> query = context.getId() != null ? createRootIdQuery(context.getEntity(), context.getId()) : createQuery(context.getEntity()); if (context.getParent() != null) { query.andQualifier(CayenneUtil.parentQualifier(context.getParent(), cayenneEntityResolver)); } return query; } CayenneQueryAssembler(EntityResolver cayenneEntityResolver); SelectQuery<T> createRootQuery(SelectContext<T> context); SelectQuery<T> createQueryWithParentQualifier(NestedResourceEntity<T> entity); SelectQuery<T> createQueryWithParentIdsQualifier(NestedResourceEntity<T> entity, Iterator<P> parentData); SelectQuery<T> createRootIdQuery(ResourceEntity<T> entity, AgObjectId rootId); SelectQuery<T> createQuery(ResourceEntity<T> entity); Expression buildIdQualifer(AgEntity<?> entity, AgObjectId id); }
CayenneQueryAssembler { public <T> SelectQuery<T> createRootQuery(SelectContext<T> context) { SelectQuery<T> query = context.getId() != null ? createRootIdQuery(context.getEntity(), context.getId()) : createQuery(context.getEntity()); if (context.getParent() != null) { query.andQualifier(CayenneUtil.parentQualifier(context.getParent(), cayenneEntityResolver)); } return query; } CayenneQueryAssembler(EntityResolver cayenneEntityResolver); SelectQuery<T> createRootQuery(SelectContext<T> context); SelectQuery<T> createQueryWithParentQualifier(NestedResourceEntity<T> entity); SelectQuery<T> createQueryWithParentIdsQualifier(NestedResourceEntity<T> entity, Iterator<P> parentData); SelectQuery<T> createRootIdQuery(ResourceEntity<T> entity, AgObjectId rootId); SelectQuery<T> createQuery(ResourceEntity<T> entity); Expression buildIdQualifer(AgEntity<?> entity, AgObjectId id);  }