我在Glassfish 4上使用JPA 2.1和Hibernate 4.3.x,也尝试了在https://coderwall.com/p/e5fxrw列出的建议,仍然得到以下错误。有人能告诉我可能是什么问题吗?无法通过反射来获取字段值hibernate JPA + GF 4
javax.persistence.PersistenceException:org.hibernate.PropertyAccessException:无法通过com.dstar.entity.PurchaseOrder.idpurchaseorder
下面的反射吸气得到一个字段的值是实体代码,跳过getter和setter方法:
@Entity
@Table(name="purchaseorder")
@PersistenceUnit(name="dstarwarehouse",unitName="dstarwarehouse")
public class PurchaseOrder implements Serializable{
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private int idpurchaseorder;
private boolean cash;
private boolean credit;
private String supplier;
private String orderedBy;
private String submittedBy;
private String approvedBy;
private Date expectedDate;
private Date creationDate;
private Date submittedDate;
private Date approvalDate;
private String purchaserName;
private double total;
@JoinColumn(name="idpurchaseorder", referencedColumnName="idpurchaseorder")
private List<Part> parts;
}
当你得到这个异常时,你到底在做什么?请详细说明您的问题,以便人们可以更有效地帮助您。 – jpangamarca 2014-10-26 13:31:27