[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4036?page=c...
]
Ed Bras commented on HHH-4036:
------------------------------
Oeppsss sorry was a bit too fast (still an interesting post that you can use as a work
around like I do).
Anyway: the following method in EntityMetamodel:
public String findEntityNameByEntityClass(Class inheritenceClass) {
return ( String ) entityNameByInheritenceClassNameMap.get( inheritenceClass.getName()
);
}
Should be replaced by:
public String findEntityNameByEntityClass(Class inheritenceClass) {
return ( String ) entityNameByInheritenceClassNameMap.get( inheritenceClass );
}
Just like you mention above...
EntityMetamodel entityNameByInheritenceClassNameMap field used
inconsistently
-----------------------------------------------------------------------------
Key: HHH-4036
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4036
Project: Hibernate Core
Issue Type: Bug
Components: core
Affects Versions: 3.3.2
Reporter: Jeremy Stone
After upgrading (from 3.3.0.SP1) to 3.3.2.GA we have started getting the follow stack
trace logged:
org.hibernate.HibernateException: Unable to resolve entity name from Class
[com.cyclone.netPrefect.admin.restriction.complex.TimeSpanRestrictionItemEntity] expected
instance/subclass of [RestrictionItem]
at
org.hibernate.tuple.entity.PojoEntityTuplizer.determineConcreteSubclassEntityName(PojoEntityTuplizer.java:363)
at
org.hibernate.persister.entity.AbstractEntityPersister.getSubclassEntityPersister(AbstractEntityPersister.java:3643)
at org.hibernate.impl.SessionImpl.getEntityPersister(SessionImpl.java:1375)
at org.hibernate.engine.ForeignKeys.isTransient(ForeignKeys.java:203)
at
org.hibernate.event.def.AbstractSaveEventListener.getEntityState(AbstractSaveEventListener.java:535)
at
org.hibernate.event.def.DefaultSaveOrUpdateEventListener.performSaveOrUpdate(DefaultSaveOrUpdateEventListener.java:103)
... etc, etc
The com.cyclone.netPrefect.admin.restriction.complex.TimeSpanRestrictionItemEntity is
mapped (with entity name TimeSpanRestrictionItem) as a joined subclass of the entity named
RestrictionItem.
I have had a look at the Hibernate source for 3.3.2.ga and it looks like problem is the
way that the org.hibernate.tuple.entity.EntityMetamodel is using it
entityNameByInheritenceClassNameMap field:
* Puts to the map are based on PersistentClass.getMappedClass() as a key - a Class
object
* Gets from the map (in findEntityNameByEntityClass method) are using the class
name
Presumably (given the name of the map field) both put and get should be using the class
name.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira