org.hibernate.MappingException: Could not determine type for: java.util.Set, at table: USERS, for columns: [org.hibernate.mapping.Column(invoices)]

后端 未结 1 802
春和景丽
春和景丽 2020-12-08 07:46

I have a problem that Hibernate is unable to determine the type for Set at the table USERS. I am trying to create a foreign key of table INVOICES through one-to-many relatio

相关标签:
1条回答
  • 2020-12-08 08:06

    If I remember correctly, Hibernate doesn't let you mix and match annotation in conjunction with field / getter. If your @Id annotation is set over a field, all your mappings should follow fields. Try moving @OneToMany @JoinColumn(name="INVOICE_ID", nullable=false) from getInvoices() to private Set<Invoice> invoices; This pattern should be applied to your Invoice class as well

    0 讨论(0)
提交回复
热议问题