-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: b7:MappingException: Unable to find column with logical name
PostPosted: Wed Dec 14, 2005 5:29 am 
Newbie

Joined: Mon Oct 24, 2005 2:19 pm
Posts: 10
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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 6:21 am 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
Please post a JIRA issue with a test case I'll check that

_________________
Emmanuel


Top
 Profile  
 
 Post subject:
PostPosted: Wed Dec 14, 2005 7:31 am 
Newbie

Joined: Mon Oct 24, 2005 2:19 pm
Posts: 10
Thanks a lot, I've done that:
http://opensource2.atlassian.com/projec ... se/ANN-177

While extracting example code I probably found the specific circumstances that trigger the bug:
The subclass has a field with @JoinTable annotation that references a column from the superclass.
If I remove this field it works ok.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.