epbernard wrote:
juicyparts wrote:
Is there a way to map a relationship from a model object to an aggregate of another model object? In this case "bug.votes = select sum(count) from votes where bug_id = ?"
I don't think so. Why don't you just map the count column of Vote ?
For this specific instance, I am mapping the count column. I guess I was asking more generally about mapping aggregates. I'm sure it's an exotic condition and isn't requested. No worries, though.
epbernard wrote:
juicyparts wrote:
So my question is, how can I support a many to one relationship when the one may not exist? Is there a way for me to intercept the process of fulfilling this relationship and examing the id /before/ an attempt to retrieve it is made?
Hum, hard. The bugzilla db sucks.
Implement the Lifecycle interface on the QA stuff and vetoe every save or update.
Proxy the Profile object. id request will not load it. then made a "public" accessor different from the mapped one. It will return the Profile if mapped_profile.id != 0).
I'm not very satisfied ot that solution however.
I don't totally understand your suggestion. Is there some documentation that covers this? It sounds interesting and I'd like to pursue it. I just need to be pointed in the right direction...
And I totally agree - The bugzilla db sucks! Definitely not implemented in the ways I've been taught. ;-)