Does SaveOrUpdate work with naturalId

Hi I am very new to Hibernate and trying to understand NaturalId.

My question is that I am trying to persist an entity with naturalId attributes and Id attribute not set, will Hibernate update the entity or will it save the entity ?

The primary key is the thing that is used by default to determine if a row exists. So when you don’t have a primary key assigned, merge (saveOrUpdate is deprecated) will result in the entity being inserted.