java.util.Hashtable cannot be cast to org.hibernate.collection.PersistentCollection

祥子哥哥 发布于 2014/06/27 23:06
阅读 224
收藏 1
hibernate执行this.goodsDao.flush();的时候,爆出转换异常。
@Entity
@Table(name = "aipanda_goods")
public class Goods extends BaseEntity {
    private static final long serialVersionUID = -6977025562650112419L;
    private Set<Product> products = new HashSet<Product>();

    @OneToMany(mappedBy = "goods", fetch = FetchType.EAGER, cascade = CascadeType.ALL, orphanRemoval = true)
    public Set<Product> getProducts() {
        return this.products;
    } 

product类有这2个实例变量

private Map<MemberRank, BigDecimal> memberPrice = new HashMap<MemberRank, BigDecimal>();
    private Map<Parameter, String> parameterValue = new HashMap<Parameter, String>();

@ElementCollection(fetch = FetchType.LAZY)
    @CollectionTable(name = "aipanda_product_member_price",joinColumns = {@JoinColumn(name= "product")})
    @MapKeyJoinColumn(name="member_price_key")
    @Column(name="member_price")
    public Map<MemberRank, BigDecimal> getMemberPrice() {
        return this.memberPrice;
    } 

貌似就是这里错误了,求大神指点。

加载中
返回顶部
顶部