Best Practice to save/edit object’s ID if empty

just want to know...

Is there a best way to handle an empty field when you save objects ? Example:

if ( !objRequest.getId().isEmpty() ){ obj.setId(objRequest.getId()); } 

I want to use the same method to save or update an object.

Thank you.

Read more here:

Content Attribution

This content was originally published by Chris Sum at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: