@Test @TestTarget(ServerVersion.AGM) public void testQuery() { RestInvocations.loadMetadata(handler, "defect"); RestInvocations.loadMetadata(handler, "release-backlog-item"); handler.addRequest(false, "GET", "/qcbin/rest/domains/domain/projects/project/defects?fields=priority,release-backlog-item.id,release-backlog-item.blocked,product-group-id&query={status[\"Fixed\"]; product-group-id[1000]}&order-by={priority[DESC]}", 200) .content("entityServiceTest_entity.xml"); EntityQuery query = new EntityQuery("defect"); query.setValue("status", "Fixed"); query.addColumn("priority", 1); query.addOrder("priority", SortOrder.DESCENDING); EntityList list = entityService.query(query); Assert.assertEquals(1, list.size()); Assert.assertEquals(86, list.get(0).getId()); }
public EntityList query(EntityQuery query) { return doQuery(query, false); }
EntityService { public EntityList query(EntityQuery query) { return doQuery(query, false); } }
EntityService { public EntityList query(EntityQuery query) { return doQuery(query, false); } EntityService(Project project, RestService restService, MetadataService metadataService, ErrorService errorService); }
EntityService { public EntityList query(EntityQuery query) { return doQuery(query, false); } EntityService(Project project, RestService restService, MetadataService metadataService, ErrorService errorService); void addEntityListener(EntityListener listener); void removeEntityListener(EntityListener listener); void refreshEntity(EntityRef ref); void getEntityAsync(EntityRef ref, EntityListener callback); Entity getEntity(EntityRef ref); EntityList query(EntityQuery query); InputStream queryForStream(EntityQuery query); Entity getDefectLink(int defectId, int linkId); Entity updateEntity(Entity entity, Set<String> fieldsToUpdate, boolean silent); Entity updateEntity(Entity entity, Set<String> fieldsToUpdate, boolean silent, boolean reloadOnFailure); Entity updateEntity(Entity entity, Set<String> fieldsToUpdate, boolean silent, boolean reloadOnFailure, boolean fireUpdate); Entity createEntity(Entity entity, boolean silent); Entity lockEntity(Entity entity, boolean silent); boolean deleteEntity(Entity entity); void unlockEntity(Entity entity); void fireEntityLoaded(final Entity entity, final EntityListener.Event event); void fireEntityNotFound(final EntityRef ref, final boolean removed); void requestCachedEntity(final EntityRef ref, final List<String> properties, final EntityListener callback); }
EntityService { public EntityList query(EntityQuery query) { return doQuery(query, false); } EntityService(Project project, RestService restService, MetadataService metadataService, ErrorService errorService); void addEntityListener(EntityListener listener); void removeEntityListener(EntityListener listener); void refreshEntity(EntityRef ref); void getEntityAsync(EntityRef ref, EntityListener callback); Entity getEntity(EntityRef ref); EntityList query(EntityQuery query); InputStream queryForStream(EntityQuery query); Entity getDefectLink(int defectId, int linkId); Entity updateEntity(Entity entity, Set<String> fieldsToUpdate, boolean silent); Entity updateEntity(Entity entity, Set<String> fieldsToUpdate, boolean silent, boolean reloadOnFailure); Entity updateEntity(Entity entity, Set<String> fieldsToUpdate, boolean silent, boolean reloadOnFailure, boolean fireUpdate); Entity createEntity(Entity entity, boolean silent); Entity lockEntity(Entity entity, boolean silent); boolean deleteEntity(Entity entity); void unlockEntity(Entity entity); void fireEntityLoaded(final Entity entity, final EntityListener.Event event); void fireEntityNotFound(final EntityRef ref, final boolean removed); void requestCachedEntity(final EntityRef ref, final List<String> properties, final EntityListener callback);  }