Quote:
According to described table structure you don't need <joined-subclass> at all: all of derived tables you've shown contains only id and type. If it really looks like this, then <subclass> will be enough.
For sake of brevity I withheld all the column props. An Orange needs to be joined to the Fruit table so it can load all the fruit properties or am I missing something?
Quote:
And the last: if you believe that your approach will help queries to run faster, you can check it first by creating database views and mapping your classes to those views instead of tables.
This would be a good exercise I will try and test this to get some real numbers.
Everything in the system is a subclass of Fruit, technically an object called Item, each concrete subclass has a table with the additional properties related to the subclass. The reason every table also has an ItemTypeKey field was to enforce constraints on the items being inserted as well as provide better performance for generic selects. The old DAL was also able to use the ItemTypeKey as a discriminator to know what object to instantiate.
I was looking at Hibernate 3.0 and it seems they have the functionality I require. Looks like I need to wait until NHibernate gets an update.
Is there a roadmap on getting a comparable NHibernate 3.0 release?