@Test void testDeleteEntities() { String entityTypeId = "MyEntityTypeId"; Query query = Query.builder().setItem("test").setOperator(Operator.MATCHES).setValue("value").build(); DeleteEntitiesRequest deleteEntitiesRequest = new DeleteEntitiesRequest(); deleteEntitiesRequest.setEntityTypeId(entityTypeId); deleteEntitiesRequest.setQ(query); entityController.deleteEntities(deleteEntitiesRequest); QueryImpl molgenisQuery = new QueryImpl<>(); molgenisQuery.eq("test", "value"); verify(dataServiceV3).deleteAll(entityTypeId, query); }
@DeleteMapping("/{entityTypeId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteEntities(@Valid DeleteEntitiesRequest deleteRequest) { Query query = deleteRequest.getQ().orElse(null); dataServiceV3.deleteAll(deleteRequest.getEntityTypeId(), query); }
EntityController extends ApiController { @DeleteMapping("/{entityTypeId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteEntities(@Valid DeleteEntitiesRequest deleteRequest) { Query query = deleteRequest.getQ().orElse(null); dataServiceV3.deleteAll(deleteRequest.getEntityTypeId(), query); } }
EntityController extends ApiController { @DeleteMapping("/{entityTypeId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteEntities(@Valid DeleteEntitiesRequest deleteRequest) { Query query = deleteRequest.getQ().orElse(null); dataServiceV3.deleteAll(deleteRequest.getEntityTypeId(), query); } EntityController(DataServiceV3 dataServiceV3, EntityMapper entityMapper); }
EntityController extends ApiController { @DeleteMapping("/{entityTypeId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteEntities(@Valid DeleteEntitiesRequest deleteRequest) { Query query = deleteRequest.getQ().orElse(null); dataServiceV3.deleteAll(deleteRequest.getEntityTypeId(), query); } EntityController(DataServiceV3 dataServiceV3, EntityMapper entityMapper); @Transactional @PostMapping("/{entityTypeId}") ResponseEntity createEntity(
      @PathVariable("entityTypeId") String entityTypeId,
      @RequestBody Map<String, Object> entityMap); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/{entityId}") EntityResponse getEntity(@Valid ReadEntityRequest entityRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/{entityId}/{fieldId}") EntitiesResponse getReferencedEntities(@Valid ReadSubresourceRequest entitiesRequest); @Transactional @PutMapping("/{entityTypeId}/{entityId}") @ResponseStatus(HttpStatus.NO_CONTENT) void updateEntity(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("entityId") String entityId,
      @RequestBody Map<String, Object> entityMap); @Transactional @PatchMapping("/{entityTypeId}/{entityId}") @ResponseStatus(HttpStatus.NO_CONTENT) void updatePartialEntity(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("entityId") String entityId,
      @RequestBody Map<String, Object> entityMap); @Transactional @DeleteMapping("/{entityTypeId}/{entityId}") @ResponseStatus(HttpStatus.NO_CONTENT) void deleteEntity(@Valid DeleteEntityRequest deleteRequest); @DeleteMapping("/{entityTypeId}") @ResponseStatus(HttpStatus.NO_CONTENT) void deleteEntities(@Valid DeleteEntitiesRequest deleteRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}") EntitiesResponse getEntities(@Valid ReadEntitiesRequest entitiesRequest); }
EntityController extends ApiController { @DeleteMapping("/{entityTypeId}") @ResponseStatus(HttpStatus.NO_CONTENT) public void deleteEntities(@Valid DeleteEntitiesRequest deleteRequest) { Query query = deleteRequest.getQ().orElse(null); dataServiceV3.deleteAll(deleteRequest.getEntityTypeId(), query); } EntityController(DataServiceV3 dataServiceV3, EntityMapper entityMapper); @Transactional @PostMapping("/{entityTypeId}") ResponseEntity createEntity(
      @PathVariable("entityTypeId") String entityTypeId,
      @RequestBody Map<String, Object> entityMap); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/{entityId}") EntityResponse getEntity(@Valid ReadEntityRequest entityRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}/{entityId}/{fieldId}") EntitiesResponse getReferencedEntities(@Valid ReadSubresourceRequest entitiesRequest); @Transactional @PutMapping("/{entityTypeId}/{entityId}") @ResponseStatus(HttpStatus.NO_CONTENT) void updateEntity(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("entityId") String entityId,
      @RequestBody Map<String, Object> entityMap); @Transactional @PatchMapping("/{entityTypeId}/{entityId}") @ResponseStatus(HttpStatus.NO_CONTENT) void updatePartialEntity(
      @PathVariable("entityTypeId") String entityTypeId,
      @PathVariable("entityId") String entityId,
      @RequestBody Map<String, Object> entityMap); @Transactional @DeleteMapping("/{entityTypeId}/{entityId}") @ResponseStatus(HttpStatus.NO_CONTENT) void deleteEntity(@Valid DeleteEntityRequest deleteRequest); @DeleteMapping("/{entityTypeId}") @ResponseStatus(HttpStatus.NO_CONTENT) void deleteEntities(@Valid DeleteEntitiesRequest deleteRequest); @Transactional(readOnly = true) @GetMapping("/{entityTypeId}") EntitiesResponse getEntities(@Valid ReadEntitiesRequest entitiesRequest); static final String API_ENTITY_PATH; }