• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

CURD operations are not working properly

 
shrida bhanutejayenduri
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when I use this statement <property name="hibernate.hbm2ddl.auto">delete</property> in hibernate.cfg.xml file ,
it is generating the error like this : Hibernate: insert into STUDENT_MST (STUDENT_NAME , MARKS, STUDENT_ID ) values (?, ?, ?)
org.hibernate.exception.ConstraintViolationException: Could not execute JDBC batch update.

Anybody rectify this.
 
Mark Spritzler
ranger
Sheriff
Posts: 17278
6
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are completely unrelated, so to speak.

the hbm2ddl is about hibernate creating the tables based on your mapping. If your mapping is wrong, then you might create a table that has a particular constraint that now won't allow your CRUD statements to run.

There can be many things wrong here, either your mapping, your code that fills in the values into your object, or the database table having wrong constraints created.

Please post your code and mapping, also make sure you use the CODE tag by clicking the Code button when replying.

Mark
 
Darvesh Niz
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
may be this might help you

http://www.makemyinfo.com/Tutorial.do?action=first

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic