Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Inner Java Enum as value class in EntityModeler



Hi Riccardo,

some time ago I had the very same problem using inner enums in Entity Modeler. I found that the easiest way was to move those enums out of their outer class and make them "normal" enums. The other, more laborious, way would be to tweak the eogenerator templates to do the replacement of '$' by '.' automatically.

jw


Am 07.11.2009 um 10:03 schrieb Riccardo De Menna:

Hi,

This issue was already discussed once but I can't really find if it was fixed somehow and I'm missing the obvious.

I'm trying more and more to force myself to use Java Enums whenever possible (instead of static fields) and often I find myself in need to serialize them to db for storage.

So I write nice to/from PLIST/BLOB factory and conversion methods to dump my Enums into whatever storage I'm using. This unfortunately requires me to fill in Entity Modeler's 'Value Class' field using an inner class (actually it's an inner Enum).

I can't use the Class.InnerClass notation. It only works with the Class$InnerClass notation. The problem is that the template then will also pickup the $ thing and wrongly write bugged templates that I have to manually fix.

It's only a matter of searching all the '$' and replacing them with a '.', but it can be tedious when you are tweaking the model often.

Is there a way to use an inner class without having to manually patch the generated templates?

rdm



Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden

References: 
 >Inner Java Enum as value class in EntityModeler (From: Riccardo De Menna <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.