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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T02:03:04+00:00 2026-05-28T02:03:04+00:00

This question is in context with the problem mentioned in this thread . I’m

  • 0

This question is in context with the problem mentioned in this thread.
I’m also facing the same problem while using JPA on MySQL. I could resolve it only when I changed the generation strategy to TABLE.

But the question is, what was the reason behind this problem and why changing the strategy to TABLE is the solution (this remains unanswered in the thread) ?

  • 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-28T02:03:05+00:00Added an answer on May 28, 2026 at 2:03 am

    To have unique ids through an inheritance hierarchy (which JPA requires), you obviously cannot do that with TABLE_PER_CLASS and IDENTITY since IDENTITY works off a table, and there are now multiple “root” tables in the inheritance hierarchy.

    e.g abstract base class “Base”, and subclasses “Sub1”, “Sub2”, “Sub3”.
    So you have actual tables “SUB1”, “SUB2”, “SUB3”. So if using IDENTITY then this will equate to something like “autoincrement” on a column when using MySQL. Hence SUB1 has its ids, SUB2 has its ids, and SUB3 has its ids … and they are independent, hence can get collisions in id … so you no longer have unique id in the inheritance hierarchy.

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

Sidebar

Related Questions

Although the context of this question is about making a 2d/3d game, the problem
Update: Please read this question in the context of design principles, elegance, expression of
This question has been asked in a C++ context but I'm curious about Java.
In the context of this question link text is possible from a Controller that
Context: .NET 3.5, VS2008. I'm not sure about the title of this question, so
This is a design question, I noticed that by time by LINQ-to-SQL Context gets
So, the context of this question is pretty specific, but I think there is
In this question I was having problem with saving objects that had foreign keys
This is a question about how to solve a possible, real, problem occurring when
I have basically the opposite problem to this question: How to prevent iframe from

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.