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 3623208
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T23:21:17+00:00 2026-05-18T23:21:17+00:00

I am using EclipseLink as JPA Provider. I want Eclipse Link to Generate my

  • 0

I am using EclipseLink as JPA Provider. I want Eclipse Link to Generate my tables so I have used drop-and-create-tables as eclipse link ddl generation strategy in persistence.xml file.

My Question is as follows :

I want to implement Many to Many relationship.I have an auction table and an item table.
An auction can have many items and one item can be in many auctions.

When Eclipse Link Generated the tables, I saw that it had created four tables in the DB.
1) Auction 2) Auction_item 3) Item and 4) Item_auction.

Auction_item has two columns 1) Auction_id 2) item_id
Item_acution has two columns 1) Item_id 2) auction_id

So in all Eclipse Link has created two bridge tables on its own to map Many To Many relationship.

Can we not have a single bridge table having auction_id, item_id to achieve the same?
If we cannot, What are the reasons?

Thanks

  • 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-18T23:21:18+00:00Added an answer on May 18, 2026 at 11:21 pm

    You likely have two @ManyToMany mappings but are missing the mappedby indication on one side. This is used to indicate that one side uses the mapping information contained in the other side, and that the relationship is controlled at the database level by that side.
    ie:

    Auction class{
      @ManyToMany
      List items;
    }
    
    Items class {
      @ManyToMany(mappedby="items")
      List auctions;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Using Glassfish 3.1 with Eclipselink as JPA provider on board. Got stateless bean with
This is similar to How to cascade persist using JPA/EclipseLink I have to entities
Have two tables named Employee and Order. The relations between the tables Employee (1)
Is there is anything in the JPA specification that describes what a valid @Embeddable
We have a Java EE application running in Glassfish 3.1, where we have our
I am creating generic reporting logic for my application and want to be able
I made a web-app using JSF, MySQL, and NetBeans(web-app template-design). Here's the error-trace I
I'm building a javaee6 application that processes smses. basically smses come in via smpp,
I had recently posted someone about populating a JTable, which is now fully functional.
I'm getting this exception in an attempt to persist an entity object in an

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.