This week's book giveaway is in the Java 9 forum.
We're giving away four copies of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications and have Sander Mak & Paul Bakker on-line!
See this thread for details.
Win a copy of Java 9 Modularity: Patterns and Practices for Developing Maintainable Applications this week in the Java 9 forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

CURD operations are not working properly  RSS feed

 
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: 17309
11
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: 123
  • 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
Boost this thread!