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

  • SEARCH
  • Home
  • 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 671567
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:23:17+00:00 2026-05-14T00:23:17+00:00

The problem: let’s say I have two tables Client , and Product , in

  • 0

The problem: let’s say I have two tables Client, and Product, in which Client has its primary key and a column called products (that points to pk’s in Product table)… ok, if I need products to point only one row, it’s nice, but if I need it to point for… 1000 rows in Product table, the products column would have to be larger enough… but I can’t predict this situation.

So, how could I design my table and how would I use hibernate with it, to achieve that “pointing” in a optmized and maybe “easy” way.

NOTE: I excluded some columns of the “design” presented here, just to keep the simplicity.

NOTE 2: Each Client’s row is unique, and only one Client is related to a Product’s row, that is, Product will be of one client and of nobody else.

  • 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-14T00:23:18+00:00Added an answer on May 14, 2026 at 12:23 am

    This is a many-to-one relationship. You can reference the Client from the Product table instead of the other way around.

    Then, you can setup a one-to-many relationship in your hibernate mapping file. Here is a nice example about how to do that: http://www.vaannila.com/hibernate/hibernate-example/hibernate-mapping-one-to-many-1.html

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

Sidebar

Related Questions

Here's my problem: Let's say I have these tables: table1 1 - a 2
PROBLEM Let's say I have a jenkins/hudson job (for example free-style) that takes two
The underlying problem - let's say my documents have categories and timestamps . If
Here is my problem: I have an array of model class(Let's say, 'addressModel' with
This is a design problem I am facing. Let's say I have a cars
I am stuck with following monad problem: Let's say I have a standard monad
so I have a problem: Let's say I have Messages and Users and the
I would like to have some suggestions for the following problem: Let's say you
I have the following problem: Let's consider we have #define SET callMe #define COLUMN(x)
The problem: Let's say I have $keyword = a sentence entered into a search

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.