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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T22:22:34+00:00 2026-05-19T22:22:34+00:00

EDIT : Changed title from inheritance to composition. Left body of question unchanged. I’m

  • 0

EDIT: Changed title from “inheritance” to “composition”. Left body of question unchanged.

I’m curious if there is an ORM tool that supports inheritance w/o creating separate tables that have to be joined.

Simple example. Assume a table of customers, with a Bill-to address, and a table of vendors, with a remit-to address. Keep it simple and assume one address each, not a child table of addresses for each.

These addresses will have a handful of values in common: address 1, address 2, city, state/province, postal code. So let’s say I’d have a class “addressBlock” and I want the customers and vendors to inherit from this class, and possibly from other classes. But I do not want separate tables that have to be joined, I want the columns in the customer and vendor tables respectively.

Is there an ORM that supports this?

The closest question I have found on StackOverflow that might be the same question is linked below, but I can’t quite figure if the OP is asking what I am asking. He seems to be asking about foregoing inheritance precisely because there will be multiple tables. I’m looking for the case where you can use inheritance w/o generating the multiple tables.

Model inheritance approach with Django's ORM

  • 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-19T22:22:34+00:00Added an answer on May 19, 2026 at 10:22 pm

    JPA (Java Persistence API, implemented by Hibernate, EclipseLink and others) supports this : You would define an Address POJO, mark it as “embeddable”, and have two entities (Customer and Vendor) having each a field of type Address (marked as “embedded”). The fields of the customer address would be mapped to columns in the Customer table, and the fields of the vendor address would be mapped to columns in the Vendor table.

    Note that there’s no inheritance here. Inheritance is for is-a relationships. A vendor is not an address, and a customer is not an address either. There is composition, though, because a vendor has an address, and a customer has an address.

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

Sidebar

Related Questions

Edit: Changed question title from Does C# allow method overloading, PHP style (__call)? -
Edit: From another question I provided an answer that has links to a lot
Is there a way to change the default pages used to edit/create/view a Sharepoint
Edit: This question was written in 2008, which was like 3 internet ages ago.
EDIT: This question is more about language engineering than C++ itself. I used C++
Edit : Solved, there was a trigger with a loop on the table (read
edit #2: Question solved halfways. Look below As a follow-up question, does anyone know
I'm writing this question from the standpoint of an ASP.NET application. However I realize
Its mostly in the title, what I mean by alternating is that there is
And why don't they change it? Edit: The reason ask is because I'm new

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.