aspose file tools
The moose likes Object Relational Mapping and the fly likes JUnit and Hibernate Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Object Relational Mapping
Reply Bookmark "JUnit and Hibernate" Watch "JUnit and Hibernate" New topic
Author

JUnit and Hibernate

Somak Dalui
Ranch Hand

Joined: Apr 19, 2005
Posts: 35
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
 
IntelliJ Java IDE
 
subject: JUnit and Hibernate
 
Threads others viewed
Unit Testing when using Hibernate
HibernateTemplate not working
How to display DB table values?
Reading a .der (file generated by openssl rsageberate command) file from classpath
Hibernate SessionFactory Problem
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com