net.sf.hibernate.MappingException: collection foreign key mapping has wrong number of columns: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTable.archiveFiles type: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTablePK

Hibernate JIRA | Mohammed Mazhar Shaikh | 1 decade ago
  1. 0

    Error Description ------------------------ %%%% Error Creating SessionFactory %%%% net.sf.hibernate.MappingException: collection foreign key mapping has wrong number of columns: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTable.archiveFiles type: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTablePK at net.sf.hibernate.mapping.Collection.validate(Collection.java:248) at net.sf.hibernate.cfg.Configuration.validate(Configuration.java:589) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:744) at helper.HibernateSession.currentSession(HibernateSession.java:52) at com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTableDAO.save(ImsTableDAO.java:28) at test.ImsTableTest.testSaveDFolder(ImsTableTest.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194) -------------------------------------------------------------------------------------------------------------------------------------------------------- Hibernate Mapping Files --------------------------------- See the attachment for 1. ImsSpecTable.hbm.xml 2. ImsTable.hbm.xml Database Table Structure ------------------------------------ 1. Table_Structure.gif

    Hibernate JIRA | 1 decade ago | Mohammed Mazhar Shaikh
    net.sf.hibernate.MappingException: collection foreign key mapping has wrong number of columns: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTable.archiveFiles type: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTablePK
  2. 0

    Error Description ------------------------ %%%% Error Creating SessionFactory %%%% net.sf.hibernate.MappingException: collection foreign key mapping has wrong number of columns: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTable.archiveFiles type: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTablePK at net.sf.hibernate.mapping.Collection.validate(Collection.java:248) at net.sf.hibernate.cfg.Configuration.validate(Configuration.java:589) at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:744) at helper.HibernateSession.currentSession(HibernateSession.java:52) at com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTableDAO.save(ImsTableDAO.java:28) at test.ImsTableTest.testSaveDFolder(ImsTableTest.java:78) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:324) at junit.framework.TestCase.runTest(TestCase.java:154) at junit.framework.TestCase.runBare(TestCase.java:127) at junit.framework.TestResult$1.protect(TestResult.java:106) at junit.framework.TestResult.runProtected(TestResult.java:124) at junit.framework.TestResult.run(TestResult.java:109) at junit.framework.TestCase.run(TestCase.java:118) at junit.framework.TestSuite.runTest(TestSuite.java:208) at junit.framework.TestSuite.run(TestSuite.java:203) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342) at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194) -------------------------------------------------------------------------------------------------------------------------------------------------------- Hibernate Mapping Files --------------------------------- See the attachment for 1. ImsSpecTable.hbm.xml 2. ImsTable.hbm.xml Database Table Structure ------------------------------------ 1. Table_Structure.gif

    Hibernate JIRA | 1 decade ago | Mohammed Mazhar Shaikh
    net.sf.hibernate.MappingException: collection foreign key mapping has wrong number of columns: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTable.archiveFiles type: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTablePK
  3. Speed up your debug routine!

    Automated exception search integrated into your IDE

    Not finding the right solution?
    Take a tour to get the most out of Samebug.

    Tired of useless tips?

    Automated exception search integrated into your IDE

    Root Cause Analysis

    1. net.sf.hibernate.MappingException

      collection foreign key mapping has wrong number of columns: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTable.archiveFiles type: com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTablePK

      at net.sf.hibernate.mapping.Collection.validate()
    2. net.sf.hibernate
      Configuration.buildSessionFactory
      1. net.sf.hibernate.mapping.Collection.validate(Collection.java:248)
      2. net.sf.hibernate.cfg.Configuration.validate(Configuration.java:589)
      3. net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:744)
      3 frames
    3. helper
      HibernateSession.currentSession
      1. helper.HibernateSession.currentSession(HibernateSession.java:52)
      1 frame
    4. com.tsystems.ecm
      ImsTableDAO.save
      1. com.tsystems.ecm.imaes.imadb.hibernate2.archive.ImsTableDAO.save(ImsTableDAO.java:28)
      1 frame
    5. test
      ImsTableTest.testSaveDFolder
      1. test.ImsTableTest.testSaveDFolder(ImsTableTest.java:78)
      1 frame
    6. Java RT
      Method.invoke
      1. sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      2. sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
      3. sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      4. java.lang.reflect.Method.invoke(Method.java:324)
      4 frames
    7. JUnit
      TestSuite.run
      1. junit.framework.TestCase.runTest(TestCase.java:154)
      2. junit.framework.TestCase.runBare(TestCase.java:127)
      3. junit.framework.TestResult$1.protect(TestResult.java:106)
      4. junit.framework.TestResult.runProtected(TestResult.java:124)
      5. junit.framework.TestResult.run(TestResult.java:109)
      6. junit.framework.TestCase.run(TestCase.java:118)
      7. junit.framework.TestSuite.runTest(TestSuite.java:208)
      8. junit.framework.TestSuite.run(TestSuite.java:203)
      8 frames
    8. JUnit3 Runner
      RemoteTestRunner.main
      1. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:474)
      2. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:342)
      3. org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:194)
      3 frames