Re: EOGenerator Velocity Templates Question

From: Mike Schrag (mschra..dimension.com)
Date: Mon Dec 03 2007 - 06:20:03 EST

  • Next message: Pierce T. Wetter III: "Re: EOGenerator vs. JavaGenerator vs. VelocityGenerator ?"

    > 1. How can I get the prototypeName from an attribute?
    > $attribute.prototypeName will not work
    > (I thought this is just java and I can access all fields and methods
    > from the EOAttribute class)
    It is just java, but you are using Entity Modeler's implementation of
    EOAttribute, not com.webobjects.xxx. They're very close, but not
    identical (EM's is optimized for things the IDE needs to do). It's
    $attribute.prototype.name in EM.

    > 2. Why the generator is using Integer instead of Number Class for
    > Datatype Integer?
    > I am using my own EOPrototypes. For sure this is a possible and
    > logical way, but it differs to
    > behavior before and I am getting problems with the Validation
    > Mechanism (casting).
    Because this is the right way :) You would need to take the stock
    templates and change them to convert those types back into Number with
    a series of #if statements if you really want Number for some reason.
    Number is wrong, though, and when I switched to that with the old
    EOGenerator last year, it made my code much more clear (and revealed
    some bugs with BigDecimals, too).

    ms



    This archive was generated by hypermail 2.0.0 : Mon Dec 03 2007 - 06:21:32 EST