Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3784626
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T11:24:19+00:00 2026-05-19T11:24:19+00:00

We are trying to build a One-to-many relation. Trying to understand how this works,

  • 0

We are trying to build a One-to-many relation. Trying to understand how this works, we stumbled across this example, which shows how to do it.

The example shows a reasonable ER diagram, but generally speaking in a One-to-many relation one doesn’t need an auxiliary table. We could insert a StudentId column into the Phone table and achieve the linking by joining the two tables through this identifier. In the example, by contrast, they need to join three tables instead.

We are wondering if such a behaviour is justified by some good practice which makes the management easy for Hibernate or if it’s just an error of the guy who wrote the article.

Any thoughts?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T11:24:20+00:00Added an answer on May 19, 2026 at 11:24 am

    I’ve found an answer, and it seems it’s exactly a sort of workaround…
    http://en.wikibooks.org/wiki/Java_Persistence/OneToMany#Join_Table

    Normally it is best to define the ManyToOne back reference in Java, if you cannot or don’t want to do this, then you can use a intermediate join table to store the relationship. This is similar to a ManyToMany relationship, but if you add a unique constraint to the target foreign key you can enforce that it is OneToMany.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying build a method which returns the shortest path from one node to
I'm trying to build a basic ListFragment based application which transitions from one ListFragment
I'm trying to build a portal in which i have two pages , one
i'm trying to build a hash with berkeley db, which shall contain many tuples
I am trying to build a class that does many photo operations, one method
I am trying to build a server which can serve for many clients. The
Okay, I'm thoroughly stumped on this one. I'm trying to build a menu of
I am trying to build RadioGroup in Android with one RadioButton checked by default.
I'm trying to build progress menu bar(similar to one on the piccsy investors http://www.piccsy.com/investors/
I'm trying to build a list page like the one in the Computers sample.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.