-->
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.  [ 1 post ] 
Author Message
 Post subject: GenericEnumUserType for nested enum classes
PostPosted: Wed Jan 17, 2007 8:14 pm 
Newbie

Joined: Wed Jan 17, 2007 7:55 pm
Posts: 1
Location: Los Angeles, CA, USA
I am using GenericEnumUserType as suggested in the wiki [1], and have noticed that some tweaking is in order if you want to nest an enum class inside another class. Example:

Code:
public class Something {
  public enum Status {
    OK,
    NOK;
  }
  private Status status;
}


In order to make this work, I had to make the nested enum static and provide the enumClass property like this: Something$Status. Using Something$1 doesn't work if the enum isn't static, and generates a ClassCastException.

Does anybody see any reason why this might be a bad idea? Is the class-file name format platform-dependent? It might be more orthogonal to support the regular "." notation for the nested class, but in the meantime, does this trip any immediate mental alarms?

1) http://www.hibernate.org/272.html


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

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.