emmanuel wrote:
Do not use a private Hashtable<Permission,Object> permissions ;
, use a Map (ie the interface)
I tried that by using:
private Map<Permission,Object> permissionsValues = new Hashtable<Permission,Object>() ;
but the problem still happens:
DEBUG [main] before transaction completion
java.lang.ClassCastException: java.util.Hashtable
at org.hibernate.event.def.FlushVisitor.processCollection(FlushVisitor.java:34)
As you see it seems Hibernate tries to do a strange cast:
coll = (PersistentCollection) collection;
and that is impossibile even if i change the type you said. It seems to me that Hibernate dont create an holder for my collection included inside a component. Do you confirm that?