I have a JPA entity similar to;
public class Inventory {
private String productname;
private String manufacturer;
private Float retailprice;
private Integer unitssold;
private String ourcomment;
}
In about 2 out of 5 queries I need the whole entity, but the rest of the time I am not interested in unitssold and ourcomment.
It feels like a waste to make a query and get a large resultlist but only needing 3/5 of the information. I would like to optimize this slightly, and I have a hunch this can be done using inheritence.
But how?