Beginner |
|
Joined: Wed Jan 16, 2008 4:00 am Posts: 41
|
Hello everybody!
I'm stuck with a special requirement to a query.
* I have an entity whose properties can be changed.
* Whenever I save, I create a log entry in another table.
* Every entity has a collection of these log elements.
* The collection must only contain the 10 latest entries, b/c otherwhise it would take a very long time to fetch all history elements
* The Log entity must not have a property of the entity that it logs.
How can I retrieve the 10 latest history elements? I need something like:
"select top 10 elements(e.logentries) from entity as e where e.Id = ? order by e.logentries.date"
... which obviously won't work ;-)
Does anybody has an idea how to solve this problem?
thx in advance & kind regards
|
|