On Jan 28, 2009, at 16:41, Ricardo J. Parada wrote:

Unfortunately I'm not cool enough for this project as it's not using ERPrototypes (yet). :-)

Well, you don't need ERProrotypes...

public class MyEO{
        ...
        
        public enum Type{
                ....
        }

        public Type typeEnum(){
                Integer type = type();
                return type == null ? null :  Type.values()[type];
        }
}

However I did look at the javaEnum prototype in the entities defined in the ERPrototypes framework and it seems like it actually maps it to a string in the database. Again, I'm not using ERPrototypes so I couldn't confirm.

Mapping an enum to a string in the database may take a few more characters but you probably don't need to worry about updating the values in the database if you decide to add a value to your enum values so that their ordinal values are different. But you do have to worry about if you rename an enum value I guess.

Yeah, I that's a pretty good idea, well, depending on your needs... For our project we have a pre-defined set of types that will *never* change, so it was not necessary.

F
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to