2013-02-14 91 views
1

我使用Spring 3与Hibernate 3,并收到此错误:Hibernate和Spring注解@OneToMany未映射类错误

Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: cz.dagoo.dros.models.Invoice.invoiceItems[cz.dagoo.dros.models.InvoiceItem]

我用尽了一切我发现了什么,但我不能够解决这个问题。

某些类未映射的可能性如何?

发票类: Invoice class

InvoiceItem类:

InvoiceItem class

Hibernate.xml: Hibernate.xml

BeanLocations.xml: BeanLocations.xml

个我的项目文件:

enter image description here

回答

1

由于异常告诉你:cz.dagoo.dros.models.InvoiceItem没有被映射为一个实体。要解决此问题,您应该在InvoiceItem上添加缺少的@Entity -annotation。

+0

谢谢!首先我使用XML,注释稍后出现,我忘记将Entity和Table添加到InvoiceItem。 – Xdg 2013-02-14 12:37:41

相关问题