Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Duplicate collection role mapping

 
Ashish Yannam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
HI,

I am new to Hibernate and i am tying to build a sample Hibernate application using the one given at http://www.laliluna.de/download/struts-hibernate-integration-tutorial-en.pdf

I am using eclipse to build this project.

I am having to tables, viz. book and customer. I have written a test code to save each of these objects in the DB.

The entity mapping files are similar, as mentioned in the tutorial.

But when I try to save these objects using session.save(),
I am getting the following exception


Can please anyone guide me on this.



 
Paul Sturrock
Bartender
Posts: 10336
Eclipse IDE Hibernate Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you show us how you configure your SessionFactory?
 
Ashish Yannam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Its an auto generated file form eclipse.
The HibernateSessionFactory is also auto generated.



 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds to me like the Book class isn't mentioned in the configuration file. You're using mapping files, right? Each Java class that acts as an entity must be mentioned in the mappings section of the configuration file.

-Cameron McKenzie
 
Ashish Yannam
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having entries for both the hbm.xml file in the hibernate.cfg.xml file.

here's the cfg.xml file

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic