Calculated values: how to? Newbie question
323537Mar 4 2003 — edited Mar 5 2003Hi,
I have a view object with attributes X and Y (both numbers). How can I add a computed attribute (X*Y) ?
I tried to
- do "New" attribute in View Object wizard"
- then set flag Queriable to false
- remove that attribute from the SQL query
- edit the code of the method getX*Y() to return getX().multiply(getY());
but It doesn't work. I get an error (oracle.jbo.DMLException) JBO-26080: Error while selecting entity for Poste
----- LEVEL 1: DETAIL 0 -----
(java.sql.SQLException) ORA-00904: "AMOUNT_TOTAL" : invalid identifier
=> My questions are
1) How can I add a computed attribute on a view so it will work
2) I have a master and a detail view object. I want the master to have an attribute getAverage() computed on the detail row set. If I override the get() method in the master view object, how can I get the detail rows so I can compute it ?
The computing of these attributes are actually a little trickier than just a multiply operation. That's why I don't want to do it via a select sum().. or select avg(..).
Help much appreciated.
Rodolphe -