I’ve got two database entities: Forum and Topic.
Topic has protected long forumId data member, which indicates of course the Topic‘s forum.
My question is what annotation to use for this data member?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
As Forum has many topics, and a topic belongs to one and only Forum, you probably want to go with a Forum type attribute annotated with
@ManyToOne:See more:
ManyToOne and JPA mapping