facebook

Hibernate Collection Mapping…

💡
Our Forums Have Moved

For help with installation, bugs reports or feature requests, please head over to our new forums.
Genuitec Community on GitHub

  1. MyEclipse Archived
  2.  > 
  3. Bugs
Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #227494 Reply

    Toniez
    Member

    I am trying to do a one-to-many mapping of a DocumentType class that contains a collection of FiedTypes. However I get the exception below if I don’t include all the mappings in the same hbm.xml file. Do I need to provide both class mappings in the same file for this to work? Can I not have a separate DocumentType.hbm.xml file and a FieldType.hbm.xml file?

    INFO: Mapping class: edu.uiuc.cs427.onlinecommons.model.DocumentType -> DocumentType
    Apr 1, 2005 10:30:18 AM net.sf.hibernate.cfg.Configuration secondPassCompile
    INFO: processing one-to-many association mappings
    net.sf.hibernate.MappingException: Association references unmapped class: edu.uiuc.cs427.onlinecommons.model.FieldType
    at net.sf.hibernate.cfg.Binder.bindCollectionSecondPass(Binder.java:1162)
    at net.sf.hibernate.cfg.Binder$CollectionSecondPass.secondPass(Binder.java:1366)
    at net.sf.hibernate.cfg.Binder$SecondPass.doSecondPass(Binder.java:1342)
    at net.sf.hibernate.cfg.Configuration.secondPassCompile(Configuration.java:618)
    at net.sf.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:761)
    at edu.uiuc.cs427.onlinecommons.service.AbstractService.setupHibernate(AbstractService.java:22)
    at edu.uiuc.cs427.onlinecommons.service.AbstractService.getSession(AbstractService.java:28)
    at edu.uiuc.cs427.onlinecommons.service.DocumentTypeService.createDocumentType(DocumentTypeService.java:29)
    at edu.uiuc.cs427.onlinecommons.service.TestDocumentTypeService.testCreateDocumentType(TestDocumentTypeService.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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:421)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)
    java.lang.NullPointerException
    at edu.uiuc.cs427.onlinecommons.service.DocumentTypeService.createDocumentType(DocumentTypeService.java:30)
    at edu.uiuc.cs427.onlinecommons.service.TestDocumentTypeService.testCreateDocumentType(TestDocumentTypeService.java:47)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Unknown Source)
    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:421)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:305)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:186)

    #227501

    Riyad Kalla
    Member

    I am reserarching this.

Viewing 2 posts - 1 through 2 (of 2 total)
Reply To: Hibernate Collection Mapping…

You must be logged in to post in the forum log in