Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

data getting saved in db without save(Hibernate)

i'm new to hibernate, while i add an element and cancel it, I see that the data gets saved in db. Nowhere in my code i called save method to save it.

like image 872
Krishna Avatar asked Oct 22 '25 05:10

Krishna


1 Answers

If you're modifying an object already associated with an Hibernate session all your modifications will be saved. Check the manual.

For example if you do something like:

  1. Load an object from a DB
  2. Modify the object by adding or removing values
  3. The modifications will be saved even if you don't use the save() method.
like image 191
Atropo Avatar answered Oct 24 '25 01:10

Atropo