enter image description hereI'm trying to do a blog - spring boot application using the Hibernate JPA implementation. My problem is that I can't use the mapping , You can see the error message I get in the two pictures below.enter image description here
For further actions, you may consider blocking this person and/or reporting abuse
Oldest comments (4)
Please let me see your post entity and person entity classes to see whether i can resolve this for you.
package com.example.demo.model;
import javax.persistence.*;
import javax.persistence.OneToMany;
import java.util.Collection;
import java.util.Date;
import java.util.List;
@Entity
public class Post {
public long getId() {
return id;
}
}
package com.example.demo.model;
import javax.persistence.*;
import java.util.Collection;
@Table
@Entity
public class Person {
@id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String username;
public String getEmail() {
return email;
}
}
I have gone through the classes which I asked, and I think the issue is the referenceColumn attribute. In your post and person entities you dont have any column name as post_id and person_id. You only have id column in both. So you should be adding id instead of post_id and person_id to the referenceColumn in Comment class. Because jpa is looking for the exact column name in other entities. I think this will work.