return Response.ok(new StreamingOutputMarshaller(app, result, hh.getAcceptableMediaTypes())).build();
}
}
protected Response delete(String version, String persistenceUnit, String type, String key, UriInfo ui, HttpHeaders hh, URI baseURI) {
PersistenceContext app = getPersistenceContext(persistenceUnit, baseURI, version, null);
if (app == null || app.getClass(type) == null) {
if (app == null) {
JPARSLogger.fine("jpars_could_not_find_persistence_context", new Object[] { persistenceUnit });
} else {
JPARSLogger.fine("jpars_could_not_find_class_in_persistence_unit", new Object[] { type, persistenceUnit });
}
return Response.status(Status.NOT_FOUND).type(StreamingOutputMarshaller.getResponseMediaType(hh)).build();
}
Map<String, String> discriminators = getMatrixParameters(ui, persistenceUnit);
Object id = IdHelper.buildId(app, type, key);
app.delete(discriminators, type, id);
return Response.ok().build();
}