Hi I have a temporal domain,
i.e. any entity has a validity time range.
For each table I ended up with
rowid (primary key) entityid start_date end_date
where rowid is unique
and any pair (entityid,inspected_date) with inspected_date between start_date and end_date is unique
Each class uses rowid as primary key and a entityid with a filter to access related information in other tables. The filter looks like ":inspected_date between start_date and end_date".
But unfortunately filters are broken in nhibernate 2.1.2, 3.0, 3.1 and 3.2. I.e. in 3.1 it only works if you turn off lazy loading and use fetch-join, so that all Objects are populated in one big fetch. If you allow for lazy loading, objects loaded later are queried without the filter.
I urgently need a work around.
Is there a way to make the where clause in a <class ... where="..."> access a non-mapped property or something like a session variable or an unmapped object???
Since inspected_date is constant during a session, I only need something which can be done within session range.
Any ideas?
Thanks
Andreas
|