-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 
Author Message
 Post subject: Default ordinal mapping for Enums dangerous?
PostPosted: Fri Dec 01, 2006 8:13 am 
Newbie

Joined: Tue May 23, 2006 12:46 pm
Posts: 17
I've just run into a case where a developer on the team forgot to mark an Enum's getter as @Enumerated(EnumType.STRING) and the ordinal values of the Enum in question changed.

Needless to say this broke our application.

Is there any way of making the string version the default instead of the ordinal value for safety?

Thanks.
Ashley


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 06, 2006 11:43 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Nope sorry, this is the specification default

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 5:26 am 
Newbie

Joined: Tue May 23, 2006 12:46 pm
Posts: 17
Ok thanks for the info.

I'll see if I can write some static code analysis to check for this (made a custom Checkstyle check)


Top
 Profile  
 
 Post subject:
PostPosted: Thu Dec 07, 2006 3:44 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Name is actually equally dangerous. There is no perfect answer.

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 4 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.