Hi Paul. See attached. I hope this helps.
I keep meaning to update to use a clazz pattern but haven't got around to
updating.
I've left the old key definition in but it is commented out.
// public static final ERXKey<$attribute.javaClassName>
${attribute.uppercaseUnderscoreName} = new
ERXKey<$attribute.javaClassName>(${attribute.uppercaseUnderscoreName}_KEY);
public static final ERXKey<$attribute.javaClassName.replace('$','.')>
${attribute.uppercaseUnderscoreName} = new
ERXKey<$attribute.javaClassName.replace('$','.')>(${attribute.uppercaseUnderscoreName}_KEY);
#end
Essentially, I just replace '$' with '.' in the class name and everything
then just works! IMHO, this should be part of the standard templates.
Best wishes,
Mark
On 10 May 2012 02:08, Paul Hoadley <[email protected]> wrote:
> Hello,
>
> I'm using an enum as an attribute type, and for neatness I've just moved
> that enum into the EO's class. It all works fine, but obviously I need to
> specify the type in the model as some.package.Foo$Bar, and then this isn't
> handled correctly by the stock Velocity templates. I thought I could live
> with it, but it turns out EO generation happens a lot more frequently
than I
> realised, and now it's annoying me!
>
> Mark Wardle wrote in February 2011:
>
> NB: when using $ to refer to an enum defined within a class, you will need
> to update your WOLips templates.
>
> I think there's a page on the wiki but I have limited connection at the
> moment.
>
>
> I couldn't find a reference to the issue on the Wiki, though I may have
> missed it. Does anyone have any modified Wonder templates that would
handle
> this, or can any Velocity experts point me in the right direction to get
> Foo$Bar translated to Foo.Bar?
>
>
> --
> Paul Hoadley
> http://logicsquad.net/
>
>
>
>
> _______________________________________________
> Do not post admin requests to the list. They will be ignored.
> Webobjects-dev mailing list ([email protected])
> Help/Unsubscribe/Update your Subscription:
> https://lists.apple.com/mailman/options/webobjects-dev/mark%40wardle.org
>
> This email sent to [email protected]
>
--
Dr. Mark Wardle
Consultant Neurologist, University Hospital Wales, Cardiff, UK
Honorary Lecturer, Cardiff University, UK
Email: [email protected] or [email protected]
Telephone: 02920745274 (secretary) or facsimile: 02920744166
_WonderEntity.java
Description: Binary data
WonderEntity.java
Description: Binary data
_______________________________________________ Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: https://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com This email sent to [email protected]
