Here's a solution to the problem (I just cpy the relevant lines):
private Class<? extends Enum> enumClass;
public void setParameterValues(Properties parameters) {
String enumClassName = parameters.getPropert("enumClassName");
try {
enumClass = Class.forName(enumClassName).asSubclass(Enum.class);
}
catch (ClassNotFoundException cnfe) {
throw new HibernateException("Enum class not found", cnfe);
}
}
Observe the way I declared the attribute enumClass. also check the way
I did the cast by using the method #asSubclass ont the Class-class.
That should do the trick - it does it for me.
Stephan |