[hibernate-issues] [Hibernate-JIRA] Created: (ANN-791) Variation on 509, can't find join columns in key

harry clark (JIRA) noreply at atlassian.com
Wed Dec 17 12:41:39 EST 2008


Variation on 509, can't find join columns in key
------------------------------------------------

                 Key: ANN-791
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/ANN-791
             Project: Hibernate Annotations
          Issue Type: Bug
          Components: binder
    Affects Versions: 3.4.0.GA
         Environment: Windows XP, DB2 (AS400), Hib 3.3.1
            Reporter: harry clark
         Attachments: hibfiles.rtf

I have what appears to be a reprise of issue 509, about finding join columns in keys. This occurs with one to many, not many to one. It occurs on the second pass over the configuration, and varies with order, as the earlier issue. When I move the class where the issue first occurs to be the first class in the config, the error occurs in another class, also in the second pass. That is, the file which raised the exception in the first example is processed successfully in the second, apparently. 

I cannot reproduce this in a simple example; there is no simple example with this database, or on this server for admin reasons. I did try on MSSQL. There are ~1360 persistent classes in the ORM, and ~1100 compound key classes. This is a legacy database, obviously, but the ORM is generated from a data modeling tool which has enforced correct key relations, not a hand-written, hand-modified, buggy schema. The join columns are correct. I would very much like to eat humble pie and get on with this project, but doesn't the order variation suggest a Hibernate problem? Has Hib processed this many compound keys? Here is the stack trace. The persistent classes are in an attached file. Thanks.

Initial SessionFactory creation failed.Unable to find column with logical name: THAZCD in org.hibernate.mapping.Table(DBAFREP) and its related supertables and secondary tables
Exception in thread "main" java.lang.ExceptionInInitializerError
	at com.kve.util.HibernateUtil.<clinit>(HibernateUtil.java:1360)
	at com.kve.main.Main.main(Main.java:22)
Caused by: org.hibernate.MappingException: Unable to find column with logical name: THAZCD in org.hibernate.mapping.Table(DBAFREP) and its related supertables and secondary tables
	at org.hibernate.cfg.Ejb3JoinColumn.checkReferencedColumnsType(Ejb3JoinColumn.java:396)
	at org.hibernate.cfg.BinderHelper.createSyntheticPropertyReference(BinderHelper.java:102)
	at org.hibernate.cfg.annotations.CollectionBinder.bindCollectionSecondPass(CollectionBinder.java:1321)
	at org.hibernate.cfg.annotations.CollectionBinder.bindOneToManySecondPass(CollectionBinder.java:654)
	at org.hibernate.cfg.annotations.CollectionBinder.bindStarToManySecondPass(CollectionBinder.java:589)
	at org.hibernate.cfg.annotations.CollectionBinder$1.secondPass(CollectionBinder.java:543)
	at org.hibernate.cfg.CollectionSecondPass.doSecondPass(CollectionSecondPass.java:66)
	at org.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:1163)
	at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:329)
	at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1319)
	at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:867)
	at com.kve.util.HibernateUtil.<clinit>(HibernateUtil.java:1356)
	... 1 more



-- 
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