File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "JUnit and Hibernate" Watch "JUnit and Hibernate" New topic

JUnit and Hibernate

Somak Dalui
Ranch Hand

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

But I once I run some insert/load I am getting unnecessary errors like
DataIntegrityViolationException: Hibernate operation: could not insert:
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 ?

I agree. Here's the link:
subject: JUnit and Hibernate
It's not a secret anymore!