[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4036) EntityMetamodel entityNameByInheritenceClassNameMap field used inconsistently

Magnus Mogren (JIRA) noreply at atlassian.com
Sun Feb 14 13:57:29 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4036?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35563#action_35563 ] 

Magnus Mogren commented on HHH-4036:
------------------------------------

Please fix this! The working code seems to be posted as a comment, so what is the problem?

> 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.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list