Search code examples
javaoraclehibernatesessionhql

SaveOrUpdate if a row is null Hibernate


I'm just a bit confused about Hibernate's saveorupdate. for example, if I try to "update" the row with the ADDRESS_TYPE of 'BI', will it be updated or a new row will be inserted?

enter image description here


Solution

  • It will update the existing record if exist in DB else It will create new record with ADDRESS_TYPE of BI. Refer hibernate documentation link.