This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes JUnit and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JUnit and Hibernate" Watch "JUnit and Hibernate" New topic
Author

JUnit and Hibernate

Somak Dalui
Ranch Hand

Joined: Apr 19, 2005
Posts: 40
I am using this code in JUnit to setup Hibernate with HSQLDB. This is without any hibernate.cfg.xml / hibernate.properties.


But I once I run some insert/load I am getting unnecessary errors like
DataIntegrityViolationException: Hibernate operation: could not insert:
org.hibernate.TransientObjectException
which otherwise works fine in a Spring+Hibernate environment.

Even simple load operations is not working. Can anyone please tell me what is wrong with this approach ?

Thanks,
Somak
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JUnit and Hibernate
 
Similar Threads
HibernateTemplate not working
Hibernate SessionFactory Problem
Reading a .der (file generated by openssl rsageberate command) file from classpath
Unit Testing when using Hibernate
How to display DB table values?