我有一个奇怪的问题。我希望将特定变量设置为null(不应该是HQL查询的一部分)。我怎样才能做到这一点。
我的档案
@Entity
@Table(name="CHECK_PRODUCTS")
@PrimaryKeyJoinColumn(name="CHECK_NO")
public class VwCheckProducts extends VwCheckProductsMaterials implements Serializable {
private static final long serialVersionUID = 1593919250034321815L;
@Column(name="CHECK_NO",length=18)
private Long bookingNo;
@Column(name="CHECK_TYPE",length=12)
private String checkType;
@Column(name="CHECK_REASON",length=24)
private String checkReason;
//setters and getters
}
现在我做的时候
checkList.addAll(q.list());
以下是形成的hibernate查询
select checkProductsc0_.CHECK_NO as CHECK_N_1_311_, checkProductsc0_1_.CHECK_TYPE as CHECK_TY2_311_, vcheckProducts0_1_.CHECK_REASON as CHECK_REA3_311_
from CHECK_PRODUCTS vwcheckProductsc0_
现在我想要的是我希望从HQL查询跳过CHECK_REASON
并将HQL查询形成为
select checkProductsc0_.CHECK_NO as CHECK_N_1_311_, checkProductsc0_1_.CHECK_TYPE as CHECK_TY2_311_ as CHECK_REA3_311_
from CHECK_PRODUCTS vwcheckProductsc0_
我如何实现这一目标?