I have a situation in which i can send JPA entity as rest request and/or get JPA entity as rest response
@RequestMapping(value = "/products", method = RequestMethod.POST)
public @ResponseBody ProductDetailsResponse createNewProduct(@RequestBody ProductDetails newProduct)
throws Exception {
ProductDetails
is an entity
@Entity
@Table(name = "product")
public class ProductDetails {
Should I use this, or have some kind of transformation from entities to another kind of objects