Base Classes and Subclasses? - SOLVED

Aug 27, 2013 at 5:06 PM
So I'm attempting to modify my current objects to use the ORM... Most of my objects are simple and contain OneToMany relationships with the other objects in the tree. However, there are some objects that aren't as simple...

I have a Base object that has 2 different types of objects that come off of it.

Is the ORM Framework smart enough to handle this situation? Will I need to setup references? I haven't seen any mention of a OneToOne relationship. For each base object there should be only one entry in the sub classed table... not sure how to handle this situation.

Any assistance would be greatly appreciated!
Jarvis
Sep 12, 2013 at 12:56 AM
Okay so after looking around on the web. There are a couple of good answers on how to do this here: http://stackoverflow.com/questions/554522/something-like-inheritance-in-database-design

At the time of posting this the top two answers have great feedback on the proper way of handling this situation.
Number 1 Answer: http://stackoverflow.com/a/554681 - Shows with SQL how you can implement an inherited object structure.
Number 2 Answer: http://stackoverflow.com/a/554552 - Talks about Martin Fowler's Patterns of Enterprise Application Architecture.

Hope this is helpful for someone else!
Jarvis