Re: [hibernate-dev] [ORM] Support for upsert semantics

2018-09-11 Thread Steve Ebersole
It's been discussed several times in the past. We already have something very similar - `Session#saveOrUpdate`. So what exactly is the difference semantically? There really is none. There is, however, a practical difference... `Session#saveOrUpdate` handling leverages Hibernate's "unsaved valu

[hibernate-dev] [ORM] Support for upsert semantics

2018-09-11 Thread Gunnar Morling
Hi, A common requirement that comes up repeatedly is "upsert" operations, i.e. either insert a record or update the existing one with the same PK, if it already exists. Many (most?) RDBMS support it, either by implementing SQL 2003's MERGE keyword or via proprietary alternatives [1]. I think it'd