Re: java 1.5 enum types and EOs
Re: java 1.5 enum types and EOs
- Subject: Re: java 1.5 enum types and EOs
- From: Stamenkovic Florijan <email@hidden>
- Date: Wed, 28 Jan 2009 16:50:05 -0400
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden