Thanks for your reply.
a) Ok, I guess that was SQL ignorance on my part. I didn't know you could do subqueries within a case/when statement. That may work.
b) Yeah, I didn't know *how* it would be done, but just wishful thinking I guess. If I understand you correctly, you are saying that by using a custom loader on a class, I'm pretty much forfeiting the query retrieval benefits I get from mapping all of my associations because I'll have to re-define them in each SQL statement again... in other words, no HQL. Do a lot of people do this? I ask because, for me, one of the big benefits of an ORM is making use of the predefined associations in the mapping. I'm not questioning the usefulness of this feature for other people, I'm just genuinely curious if I'm unique or just looking at it the wrong way...
So it looks like option (a) may work for me (the discriminator formula)...
But if anybody knows of an approach where I can use a view of my base table for creating a discriminator column without sacrificing functionality, I would be very grateful.
Thanks!
|