• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why ConstraintViolationException is generated?

 
prakash. rajeev
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"increment" does not work with Oracle.
 
prakash. rajeev
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which <generater-class> (in hbm.xml) file is suitable for Oracle.
 
Christian Dillinger
Ranch Hand
Posts: 197
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.roseindia.net/hibernate/hibernateidgeneratorelement.shtml

We always take a sequence because we also have triggers that create IDs when needed.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic