Thank you for your quick reply, emmanuel.
Fortunately, I found the reason for the exception - it was just my error!
I forgot to mark the inner class (the enum) to be public.
This is the (reduced) corrected code:
Code:
@Entity
public class Transport {
public static enum TKind{
SHIP,
PLANE;
};
}
@Id
long pk;
TKind kind; // enum must be public
.....
If I do not mark the inner class as being public I receive the exception. What was a bit irritating was the exception message itself which stated
can not access a member of class enumeration.TKind with modifiers "public static".
In fact the enum MUST be public static. However, Hibernate stays the most important and fascinating tool for me for more than 5 years now! That's why my students have to learn hibernate.