• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: java 1.5 enum types and EOs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >java 1.5 enum types and EOs (From: "Ricardo J. Parada" <email@hidden>)
 >Re: java 1.5 enum types and EOs (From: Stamenkovic Florijan <email@hidden>)
 >Re: java 1.5 enum types and EOs (From: "Ricardo J. Parada" <email@hidden>)

  • Prev by Date: Re: java 1.5 enum types and EOs
  • Next by Date: Re: [WORKED AROUND] Re: Bug in client side EOF locking?
  • Previous by thread: Re: java 1.5 enum types and EOs
  • Next by thread: mightDelete Question
  • Index(es):
    • Date
    • Thread