From: Gavin_King/Cirrus%<CI...@ci...> - 2002-07-16 03:42:45
|
>I=B4ve been thinking of extending Hibernate to allow for a seperate ta= ble >for subclasses. Cool! We need this feature :) >I allready developed a test case when i was on holliday >last week. I would extend the mapping file with a possible table >property in the subclass element that would allow the additional >properties of this class to be mapped to another table. Yes, thats exactly how I think we should approach this. I think the biggest problem we will have here is making this new mapping style work= together with outerjoin fetching. What you should be able to do as a temporary approach is to implement this ONLY for the case where hibernate.use_outer_join=3Dfalse. (I can take over from there.) The second difficult part will be integrating this with find() queries. Once again, I will take care of this.... So basically, If you could get it working for Session.load() (using ANSI outerjoins) Session.save() (using multiple sql inserts) Session.flush() (using multiple sql updates) Session.lock() (using ANSI outerjoins ... trivial ) then you should get Session.iterate() just about for free. And then I will do Session.find() and we'll worry about the outerjoin fetching stuff later. What this means is that most of the work (for you) would be in the one class cirrus.hibernate.impl.ClassPersister It may or may not be necessary to subclass ClassPersister to add this functionality. Whichever way is fine by me..... >Is it a performance benefit to map to multiple tables? If not it might= >be useless anyway - might depend on the database... Usually it would be a performance *loss*, except for very deep class heirarchies. However, for people mapping legacy data or for people who love normalized relational models, it is a very-much-needed feature. looking forward..... peace Gavin= |