I have just tried to upgrade from hibernate rc2 with annotations b5 to
hibernate final and annotation b7.
I am getting this exception on startup:
Code:
org.hibernate.MappingException: Unable to find column with logical name: inspections_strangedestination.id
at org.hibernate.cfg.Mappings.getPhysicalColumnName(Mappings.java:495)
at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:346)
at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:79)
at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:856)
at org.hibernate.cfg.annotations.CollectionBinder.bindManyToManySecondPass(CollectionBinder.java:747)
at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:419)
at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:380)
at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:35)
at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1031)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:227)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1146)
at com.viewcomm.hibernate.HibernateUtil.<clinit>(HibernateUtil.java:66)
Seems annotations beta 7 tries to map the column name from logical to physical (whatever that means exactly):
Code:
referencedColumnName = mappings.getPhysicalColumnName( referencedColumnName, table );
This fails if the field is defined in a super class with InheritanceType.JOINED because when resolving the column hibernate tries to access the denormalized super table, but InheritanceState.hasDenormalizedTable() states that only TABLE_PER_CLASS has denormalized tables.