private EntityManager em;
@Override
public Response createProduct(Product product, UriInfo uriInfo)
{
ProductEntity entity = new ProductEntity();
domain2entity(entity, product);
em.persist(entity);
em.flush();
System.out.println("Created product " + entity.getId());
UriBuilder builder = uriInfo.getAbsolutePathBuilder();
builder.path(Integer.toString(entity.getId()));
return Response.created(builder.build()).build();
}