Re: [Modeling-users] Aggregate values in objects
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2004-08-12 22:32:27
|
Kertis, Dennis wrote: > Is there a way I can get a field populated with an aggregate value. > i.e., I want a manager to have a field which would contain how many > employees work for him by doing a select count(*). I parsed through > the fetching section of the doc and didn't find a way to do this. For COUNT(*) there is a dedicated method: EC.fetchCount(), which has the very same syntax as EC.fetch() and returns the number of objects matching the qualifier. I recommend that you define a method returning this count, rather than have an integer field populated with such a value, or else you should be prepared to deal with every possible situations where this count can change if you do not want that this field's value get out of sync. Other aggregates are not yet supported; I believe we formerly discussed this here, probably with Ernesto, among others. I do not have access to the archives here, Erny could you maybe confirm? -- Sébastien. |