I encountered this same problem. The issue is that Hibernate is automatically trying to use "dynamic entity mode" because your class implements Map. Hibernate's logic goes like this...
Code:
String entityName = interceptor.getEntityName(object);
if (entityName == null) {
if (object instanceof Map) {
// Use dynamic entity mode
} else {
entityName = object.getClass().getName();
}
}
The solution I used was to set a Configuration level Interceptor (that extends EmptyInterceptor) to check for my special case:
Code:
public String getEntityName(Object object) {
if (object != null && object instanceof MyClassThatImplementsMap) {
return object.getClass().getName();
} else {
return super.getEntityName(object);
}
}
This completely solved the problem!
Here's a link to the relevant Hibernate documentation:
http://www.hibernate.org/hib_docs/refer ... vents.html
Hope this helps!