You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am testing requery in Java with the aim of migrating some of our projects and I was wondering how best to define foreign entities ie (OneToOne, OneToMany, ManyToOne, ManyToMany). I have been trying my hand out defining some models but I seem to be getting an error in the SQL and I cannot figure out where I am going wrong.
I am able to query the User from DB but once I call the user.getRole() method my SQL is output as "select role from users where id =1 " where role is supposed to be a "role_id" field.
Adding the @joincolumn with "role_id" as the name of the field on the @manytoone end makes no difference when running the code.
Kindly assist
The text was updated successfully, but these errors were encountered:
Hello,
I am testing requery in Java with the aim of migrating some of our projects and I was wondering how best to define foreign entities ie (OneToOne, OneToMany, ManyToOne, ManyToMany). I have been trying my hand out defining some models but I seem to be getting an error in the SQL and I cannot figure out where I am going wrong.
(Attached are the AbstractUser & AbstractRole entities)
AbstractRole.java.txt
AbstractUser.java.txt
I am able to query the User from DB but once I call the user.getRole() method my SQL is output as "select role from users where id =1 " where role is supposed to be a "role_id" field.
Adding the @joincolumn with "role_id" as the name of the field on the @manytoone end makes no difference when running the code.
Kindly assist
The text was updated successfully, but these errors were encountered: