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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:23:36+00:00 2026-05-26T22:23:36+00:00

In most of the web application, i have seen one base class consisting common

  • 0

In most of the web application, i have seen one base class consisting common properties and number of subclasses extending base class . So my question here is which strategy we should go for among Table Per Subclass Vs Table Per concrete class. I personally feel we should go for table per subclass because in future if we want to introduce the common column we can do it at one place but in case of concrete class we have to do it in multiple tables. Right?

But yes if we want to fetch all deatils from all child tables i think Table per concrete class will be helpful Because we have to simply union the records from all tables but in case of Table per Sub class along with union we have to introduce the join with parent table which will be extra costlier .Right?

  • 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-26T22:23:37+00:00Added an answer on May 26, 2026 at 10:23 pm

    You might be interested in Section 2.12 “Inheritance Mapping Strategies” of the JPA 2.0 specification, as it sums up all possbible inheritance types as well as their advantages and drawbacks. Let me pull out just the most interesting fragments:

    2.12.1 Single Table per Class Hierarchy Strategy

    This mapping strategy provides good support for polymorphic
    relationships between entities and for queries that range over the
    class hierarchy. It has the drawback, however, that it requires that
    the columns that correspond to state specific to the subclasses be
    nullable.

    2.12.3 Table per Concrete Class Strategy

    This strategy has the following drawbacks:
    – It provides poor support for polymorphic relationships.
    – It typically requires that SQL UNION queries (or a separate SQL query per subclass) be issued for queries that are intended to range over the class hierarchy.

    2.12.2 Joined Subclass Strategy

    It has the drawback that it requires that one or more join operations
    be performed to instantiate instances of a subclass. In deep class
    hierarchies, this may lead to unacceptable performance. Queries that
    range over the class hierarchy likewise require joins.

    Also, if you’re planning to be JPA-compatible, remember that the JPA-provider doesn’t have to support TABLE_PER_CLASS strategy type.


    I personally feel we should go for table per subclass because in
    future if we want to introduce the common column we can do it at one
    place but in case of concrete class we have to do it in multiple
    tables.

    True, but JOINED strategy also provides you the same feature and allows to specify common properties in one table.

    Hope that helps!

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

Sidebar

Related Questions

I have a particular web application that like most others, has to account for
Most web applications have a Location field, in which uses may enter a Location
What's the best/most efficient way whether the user of my .NET web application is
Over the years most web developers will have built an arsenal of tools or
I'm writing a web application (in Python, not that it matters). One of the
I have to write a web application, and I am not sure which technology
I have developed a web based application which allows a client/user to upload a
I'd like the users of my web application to not have to register a
We have one server running Windows Server 2003 for our production web server. Our
I have a web application where users can create topics and also comment on

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.