5 Mar 19:11
difficult object relational mapping
Anton Pirker <helma <at> gmiatlich.net>
2008-03-05 18:11:02 GMT
2008-03-05 18:11:02 GMT
Hi list!
I am trying to do a rather difficult object relational mapping (orm) and
i am stuck. Maybe someone can help!
My object-relations:
--------------------
i have events. every event has several (1..n) entries (posts). every of
these entries has several (1..n) changes. a change has a date.
Now i want to have a collection of events ordered by the date of the
changes of the entries.
In SQL this looks like this:
-----------------------------
select
ev.event_id,
ev.event_title,
max(ch.change_datetime)
from
events ev,
entries en,
changes ch
where
ev.venue_id = 56 and
ev.event_id = en.event_id and
en.entry_id = ch.change_parent_id and
ch.change_parent_prototype = "Entry"
(Continue reading)
Regards,
Philipp
RSS Feed