Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Relational: TPH inheritance mapping pattern #247

Closed
rowanmiller opened this issue May 22, 2014 · 24 comments
Closed

Relational: TPH inheritance mapping pattern #247

rowanmiller opened this issue May 22, 2014 · 24 comments
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@rowanmiller
Copy link
Contributor

No description provided.

@rowanmiller rowanmiller added this to the Backlog milestone May 22, 2014
@divega divega modified the milestones: 1.0.0, Backlog Sep 4, 2014
@divega
Copy link
Contributor

divega commented Sep 4, 2014

The highest priority is to support some form of table per hierarchy a.k.a single table inheritance.

@irperez
Copy link

irperez commented Feb 6, 2015

+1 on the various mapping patterns (TPT, TPH, etc) Please don't forget a mix of the two in a single graph.

@kidchenko
Copy link

+1 for the inheritance support, at least one strategy.

@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 11, 2015

Please do NOT support mixing strategies...

@ilmax
Copy link
Contributor

ilmax commented Feb 11, 2015

Please do not support inheritance OOB, can this be achieved in a separate package so to make pay for play real?

@kidchenko
Copy link

Since we do not support inheritance, what better alternative? I was thinking of creating a single class and put all the attributes in it, so work with a single table and a single class, simulating a strategy TPH

@irperez
Copy link

irperez commented Feb 11, 2015

Without at least TPH, we cannot use EF. For simple applications, the above scenarios may be fine. But for very complex scenarios especially in a world of medical applications (my company develops medical software for cancer regimens), we would not be able to handle such simple scenarios.

@rowanmiller
Copy link
Contributor Author

@Kiide & @irperez - This is just a limitation of the current pre-release versions of EF7. Pre-release are just designed for trying out EF7 so we definitely would not recommend using it to try and write real applications with.

@kidchenko
Copy link

Yes i uderstand

@phillip-haydon
Copy link

As part of EF 7, are you going to fix all the bugs that are currently in 6? Like mapping to the same foreign key for different relationships?

@rowanmiller rowanmiller modified the milestones: 7.0.0, Backlog May 26, 2015
@rowanmiller
Copy link
Contributor Author

Moving into 7.0.0 since we are in the process of enabling at least some scenarios at the moment.

@issafram
Copy link

issafram commented Aug 5, 2015

For TPH, allow us to pick a custom Discriminator. There should be no reason to store a string field for each row. That is my biggest issue with TPH.

@anpete
Copy link
Contributor

anpete commented Aug 5, 2015

@issafram In EF7 you can pick any property for the discriminator.

@issafram
Copy link

issafram commented Aug 5, 2015

@anpete will it support using enums for the discriminator?

@anpete
Copy link
Contributor

anpete commented Aug 5, 2015

@issafram Yes.

@weitzhandler
Copy link
Contributor

Any workaround even temporary? Can's live with all subclasses being generated as separated tables.

Is there even a list to exclude base classes?

For instance I have TeacherBase and Teacher, and in fact don't want the TeacherBase at all as a table, I only need Teacher to be generated carrying all properties include the base class'.

@issafram
Copy link

@weitzhandler, did you try the NotMapped annotation?

Maybe you are asking for TPC (Table Per Concrete Type), but that can get confusing with foreign keys in other tables.

@weitzhandler
Copy link
Contributor

I've opened a separate issue.
#2907

@divega
Copy link
Contributor

divega commented Aug 23, 2015

@rowanmiller this item seems to represent the inheritance work as a whole and it is assigned to the 7.0.0 release. Should it have a priority and an owner or should we close it?

@rowanmiller rowanmiller changed the title Relational: Inheritance mapping patterns Relational: TPH inheritance mapping pattern Aug 24, 2015
@rowanmiller
Copy link
Contributor Author

Yep, changed title to reflect that we are implementing TPH for initial release (we have other issues on the backlog to track enabling other patterns).

Assigning to Andriy since he has the inheritance ball at the moment (for the model building work). We should keep this open until things work well end-to-end.

@leolana
Copy link

leolana commented Aug 27, 2015

@ErikEJ because do NOT support mixing strategies ?

@rowanmiller rowanmiller modified the milestones: 7.0.0-rc1, 7.0.0 Sep 17, 2015
@jimmymain
Copy link

how is TPC inheritance being tracked?
I have an existing project where each class within the hierarchy is mapped to a particular table.
I will move this model over to version 7 once it's implemented. Is this strategy also being tracked by this issue 247. The title does not make this clear.

edit: I see this is being tracked as issue 2266, and is rediculously being debated as a feature.

@rowanmiller
Copy link
Contributor Author

@jimmymain #2266 is actually for TPT, I opened #3170 to track TPC (they were originally all tracked by this issue, but then we split it out since we are only implementing TPH for the initial stable release)

@AndriySvyryd
Copy link
Member

TPH is now fully implemented

@AndriySvyryd AndriySvyryd removed their assignment Oct 22, 2015
@jnm2 jnm2 mentioned this issue Feb 16, 2016
@ajcvickers ajcvickers added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Oct 15, 2022
@ajcvickers ajcvickers modified the milestones: 1.0.0-rc1, 1.0.0 Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

No branches or pull requests