Let's say that Foo has some properties of size, color, and alignment.
So the Foo in the database has these properties (and you have already determined that this is the correct one using your uniqueness attribute)
id=1, size=12, color=null, alignment="c"
Then let's say that the new Foo (newFoo) object has the following properties
id=(none yet), size=14, color="red", alignment=null
The options you have are to either use the saveOrUpdate() method or the merge() method. Both will result in the new object being saved over the old object but maintaining the old object's id.
The new object stored will have the properties of newFoo above but with the id set to 1.
However, if you want to only override certain properties of Foo, you might have to load the object from the database and copy them over manually. For example, in this case, alignment is overwritten with null. If you wanted alignment to only be overwritten in cases where the new value is not null, then I think you need to copy the values over manually.