Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relationship Management #805

Open
name256 opened this issue Aug 3, 2018 · 0 comments
Open

Relationship Management #805

name256 opened this issue Aug 3, 2018 · 0 comments

Comments

@name256
Copy link

name256 commented Aug 3, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant