Is there an ORM that supports composition w/o Joins

Posted by Ken Downs on Stack Overflow See other posts from Stack Overflow or by Ken Downs
Published on 2011-02-05T14:57:07Z Indexed on 2011/02/05 15:25 UTC
Read the original article Hit count: 285

Filed under:
|

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

© Stack Overflow or respective owner

Related posts about database-design

Related posts about orm