tl;dr
My code gets an array of javascript/json objects from a Restful GET. How do I write code to loop and retrieve, for display, a description (or
Spring Projection
@Projection(name = "dummyNameForProjection", types = { Product.class })
public interface VirtualProjection {
// this will get the attribute name from the product entity
String getProductName();
//this will get the name of the category entity related to the product
@Value("#{target.category.name}")
String getCategoryName();
}
Just include projection name in your request ex: /products?projection=dummyNameForProjection