The error: hibernate.AnnotationException: mappedBy reference an unknown target entity property
I know why the error is here but the longer i stare at it the more I cannot find it :). I just need another persons perspective.
Then I have entities for User, Company and Transaction.
The relationships are shown here:
Transaction:
@ManyToOne
@JoinColumn(name = "userId")
User user;
@ManyToOne
@JoinColumn(name = "companyId")
Company company;
Company
@JsonIgnore
@OneToMany(mappedBy = "transaction")
List<Transaction> transactions;
User
@JsonIgnore
@OneToMany(mappedBy = "transaction")
List<Transaction> transactions;
Here is the full error:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.AnnotationException: mappedBy reference an unknown target entity property: top100.models.Transaction.transaction in top100.models.User.transactions
So the error is to do with the relationship but I cannot spot my mistake.
Thanks :)