有两张表account,supplier
查询的时候我想取部分字段
<many-to-one
        name="supplier"
        column="relate_id"
        class="com.scm.domain.Supplier"
        fetch="join"
        /><set name="accounts" inverse="false" cascade="all"  >
         <key column="relate_id"></key>
         <one-to-many class="com.scm.domain.Account"/>
        </set>String hql = "select new Account(account.id,account.name,account.account,account.password,supplier) from Account account left join fetch account.supplier";
但是这样取会出错
java.lang.NullPointerException
org.hibernate.util.ReflectHelper.getConstructor(ReflectHelper.java:195)
这是什么原因,我在Account类里已经有了构造函数:
public Account(Integer id, String name, String account, String password, Supplier supplier) {
this.id = id;
this.name = name;
this.account = account;
this.password = password;
this.supplier = supplier;

}