Created
March 22, 2019 13:05
-
-
Save rinaldodev/7a0421ef78fa78eb8b25b25e08684b06 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Usuario { | |
@Id | |
private Long id; | |
@Column | |
private String primeiroNome; | |
@Column | |
private String sobrenome; | |
@Transient | |
private Boolean atualizar; // não faça isso | |
} | |
public class CadastroUsuarioService { | |
public void salvarUsuario(Usuario usuario) { | |
if (usuario.getAtualizar()) { | |
// atualiza dados do usuario | |
} else { | |
// cadastra novo usuario | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment