On 12/19/05 7:35 PM, Mark D. Anderson wrote:
> Just following up on the "inheritance support" topic of a month ago, and
> wondering if support for the 3rd pattern for inheritance ("union mapping" --
> put all in one superset table) is coming soon? That is the one that we agreed
> would be a good first one to tackle. It sounds like this is something there
> used to be support for? Maybe it just needs some documentation or dusting?

I still haven't officially tackled inheritance mapping yet.  I'm planning to
add arbitrary-depth joins first, but I'll get to it eventually.  In the
meantime, it's it should be possible to get union mapping to work
"manually."  One approach might go something like this.

1. Make an RBDO class to front the big superset db table.

2. Make a series of subclasses and then delete all but the columns that are
relevant to them.

3. In the base class made in step 1, make a custom column accessor method
(or use an on_set trigger on a regular column accessor method) for the
discriminant field (e.g., "type") that re-blesses the object into the
appropriate class based on the value of the discriminant column.

4. In the Manager methods for each class, hard-code a "type => ..." query
argument that gets passed regardless of any other query parameters.

I think that'd about cover it.  My first crack at automating this will
probably use a similar technique behind the scenes, but with a nicer
interface from the outside.  I'm not sure what that'd look like, however.
Suggestions and/or patches welcome :)

-John




-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Rose-db-object mailing list
Rose-db-object@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rose-db-object

Reply via email to