We've been using single-table inheritance here for quite a while.
Let's start with an example:
A person can send an email or fax.  They share plenty of fields and plenty
of methods, but there is a bit of divergence.
So we have something like...
Person ->> Message where Message can be either EmailMessage (MESSAGE_TYPE 1)
or FaxMessage (2).
I notice that when this method is traversed, it creates two SQL statements
for each Message like:
SELECT ... FROM MESSAGE WHERE MESSAGE_ID = 1234 AND MESSAGE_TYPE = 1;
SELECT ... FROM MESSAGE WHERE MESSAGE_ID = 1234 AND MESSAGE_TYPE = 2;
Is this the default behavior?  If so, then it seems a bit of a waste to me -
why not say, either...WHERE MESSAGE_ID = 1234; or ...WHERE MESSAGE_ID = 1234
AND MESSAGE_TYPE in (1, 2);
By creating worthless calls that will return 0 records, we're needlessly
slowing our app. 
Any advice?

Thanks, and happy Year of the Rat!

Charles Koppelman
Programmer
Youth For Understanding, USA

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to