【发布时间】:2009-08-31 23:06:04
【问题描述】:
我有一个类似的 JPA 实体;
public class Inventory {
private String productname;
private String manufacturer;
private Float retailprice;
private Integer unitssold;
private String ourcomment;
}
在大约五分之二的查询中,我需要整个实体,但其余时间我不对 unitssold 和 ourcomment 感兴趣>.
进行查询并获得大量结果列表但只需要 3/5 的信息感觉就像浪费。我想稍微优化一下,我预感这可以使用继承来完成。
但是怎么做呢?
【问题讨论】: