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.
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.