protected Response deleteInternal(String version, String persistenceUnit, String type, String id, HttpHeaders headers, UriInfo uriInfo) { JPARSLogger.entering(CLASS_NAME, "deleteInternal", new Object[] { "DELETE", headers.getMediaType(), version, persistenceUnit, type, id, uriInfo.getRequestUri().toASCIIString() }); try { PersistenceContext context = getPersistenceContext(persistenceUnit, type, uriInfo.getBaseUri(), version, null); Map<String, String> discriminators = getMatrixParameters(uriInfo, persistenceUnit); Object entityId = IdHelper.buildId(context, type, id); context.delete(discriminators, type, entityId); return Response.ok().build(); } catch (Exception ex) { throw JPARSException.exceptionOccurred(ex); } }
protected Response deleteInternal(String version, String persistenceUnit, String type, String id, HttpHeaders headers, UriInfo uriInfo) { JPARSLogger.entering(CLASS_NAME, "deleteInternal", new Object[] { "DELETE", headers.getMediaType(), version, persistenceUnit, type, id, uriInfo.getRequestUri().toASCIIString() }); try { PersistenceContext context = getPersistenceContext(persistenceUnit, type, uriInfo.getBaseUri(), version, null); Map<String, String> discriminators = getMatrixParameters(uriInfo, persistenceUnit); Object entityId = IdHelper.buildId(context, type, id); context.delete(discriminators, type, entityId); return Response.ok().build(); } catch (Exception ex) { throw JPARSException.exceptionOccurred(ex); } }