aspose file tools*
The moose likes Object Relational Mapping and the fly likes Why ConstraintViolationException is generated? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Why ConstraintViolationException is generated? " Watch "Why ConstraintViolationException is generated? " New topic
Author

Why ConstraintViolationException is generated?

prakash. rajeev
Greenhorn

Joined: Feb 17, 2010
Posts: 15
Hi all,


I am getting the following exception in my project while inserting the data to the database.I am using Struts1 with Hibernate (but no spring ) with Oracle and my connection is established but following error is coming in my Tomcat Console.

The error is like this:





My Bean class is like this:




My hbm.xml file is:



And My Action class in Struts is:





Any help in solving this is highly appreciable.

Christian Dillinger
Ranch Hand

Joined: Jul 20, 2009
Posts: 189
"increment" does not work with Oracle.
prakash. rajeev
Greenhorn

Joined: Feb 17, 2010
Posts: 15
Which <generater-class> (in hbm.xml) file is suitable for Oracle.
Christian Dillinger
Ranch Hand

Joined: Jul 20, 2009
Posts: 189
http://www.roseindia.net/hibernate/hibernateidgeneratorelement.shtml

We always take a sequence because we also have triggers that create IDs when needed.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why ConstraintViolationException is generated?