Boolean consignment = (Boolean) request.getData().get("consignment");
Boolean scallable = (Boolean) request.getData().get("scallable");
Boolean deleteInd = !(Boolean) request.getData().get("active");
Integer categoryId = RequestUtil.getInteger(request.getData().get("categoryId"));
Product p = coreManager.get(Product.class, id);
p.setSku(sku);
p.setBarcode(barcode);
p.setLongDescription(longDescription);
p.setShortDescription(shortDescription);
p.setScallable(scallable);
p.setConsignment(consignment);
p.setDeleteInd(deleteInd);
Category category = coreManager.getCategory(categoryId);
p.setCategory(category);
try {
Product savedProduct = coreManager.save(Product.class, p);
resp = mapper.map(savedProduct, DisplayProduct.class);
}catch (DataIntegrityViolationException dive){
SgwtRestErrorResponse resp1 = new SgwtRestErrorResponse(-4);