Xdg
Xdg

Reputation: 1835

Hibernate and Spring Annotation @OneToMany unmapped class error

I'm using Spring 3 with Hibernate 3 and getting this error:

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]

I've tried everything what I found but I'm not able to solve this problem.

How is it possible that some class is unmapped?

Invoice class: Invoice class

InvoiceItem class:

InvoiceItem class

Hibernate.xml: Hibernate.xml

BeanLocations.xml: BeanLocations.xml

My project files:

enter image description here

Upvotes: 1

Views: 801

Answers (1)

Aleksander Blomskøld
Aleksander Blomskøld

Reputation: 18552

As the exception tells you: cz.dagoo.dros.models.InvoiceItem is not mapped as an entity. To solve this issue you should add the missing @Entity-annotation on InvoiceItem.

Upvotes: 1

Related Questions