EJB異常:Collection has neither generic type or OneToMany.targetEntity() defined:
如出現(xiàn)類似以下異常:
org.hibernate.AnnotationException: Collection has neither generic type or OneToMany.targetEntity() defined: org.svse.org.model.Order.orderItems
請(qǐng)檢查orderItems這個(gè)屬性是否使用了泛型,如:Set<OrderItem>.
如果未使用泛型,請(qǐng)?jiān)贠neToMany注釋中使用targetEntity指定元素的類型