/** * Delete entity and cascaded associations : parameters, events then subscription. Note that remote data are not * deleted. Links are just destroyed. * * @param id * the entity identifier. * @throws Exception * When the delete fails. Managed at JAX-RS level. */ @Path("{id:\\d+}") @DELETE public void delete(@PathParam("id") final int id) throws Exception { // Deletion without remote deletion delete(id, false); }
/** * Delete entity. Should be protected with RBAC. * * @param id * The entity identifier. * @throws Exception * When the delete fails. Managed at JAX-RS level. */ @DELETE @Path("{id:\\d+}") public void delete(@PathParam("id") final int id) throws Exception { final Project project = findOneVisible(repository::findOneVisible, id, Function.identity()); for (final Subscription subscription : project.getSubscriptions()) { subscriptionResource.delete(subscription.getId()); } repository.delete(project); }