解決方式:
1.可以將報錯位置的
@ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "TypeId") public CouponType getType() { return type; }
修改為
@ManyToOne(fetch = FetchType.EAGER) @JoinColumn(name = "TypeId") public CouponType getType() { return type; }