If i use ex.merge(obj), now if in object obj i set the primary key to a value which is not present in database, will it create a new record or will it throw an exception?
for example
if obj with pk val = 19 doesnot exist in database,and i set
obj.setPk(20);
obj.setName("nm");
em.merge(obj) // will this throw an exception or create a new record?`enter code here`