Computed Attributes

From: Bruce Alspaugh (compulinklt..mail.com)
Date: Wed Feb 15 2006 - 15:22:56 EST

  • Next message: Bryan Lewis: "Re: Oracle Fetch Limit Issue"

    I would like to be able to add a computed field to my displays that would be based on the other attributes in that table row. For example, a line total that is the item price times the item count plus the tax and shipping for that item. I'm probably making this way too complicated.

    When I use the DVModeler, I noticed that my only options are "nocalc" and "lookup." It would be handy to have a "calc" option for computed fields where I could put the formula in. I suppose I could use Cayenne Modeler to generate the base Java classes, and then add the attribute to the derived class. The problem is that since it was added by hand, the computed field is not in the XML generated by the Modeler, which means it won't be picked up by the DVModeler and I can't add it to a DataView.

    If I could add a user-defined ObjAttribute in the Modeler, it could generate a "stub" for it when I generate Java classes that I could fill in by hand. I could then add formatting, caption, etc. in DVModeler.

    What is the recommended way to handle this?

    Bruce



    This archive was generated by hypermail 2.0.0 : Wed Feb 15 2006 - 15:23:04 EST