I start with the play framework. Take a question about JPA and mappings in the game structure,
I have a student table and a mentor table attached to each other.
Student table:
id, name, class, grade
Mentor Table:
id, name, department, student_id
In the foregoing, a mentor may or may not have a student associated with him / her. I am doing a one-to-one mentor model,
@OneToOne
@JoinColumn(name="fk_student_id", referencedColumnName="id")
private student Student;
When I try to run this, I get
JPA error occurred (EntityManagerFactory cannot be built): property mapping has the wrong number of columns: models.Mentor.student type: models.Student.
I am sure that I have displayed all Student fields as shown below,
Student.java
@Id @GeneratedValue(strategy=GenerationType.AUTO)
private long id;
@Column(name="name")
private String name;
@Column(name="class")
private String cls;
@Column(name="grade")
private String grade;
What am I missing here?
Thank you for your time.
Regards, Abi