Last active
March 22, 2019 13:13
-
-
Save rinaldodev/60cbc6b7d7774c7fcd2f484119f1c78b 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
@Entity | |
public class Usuario { | |
@Id | |
private Long id; | |
@Column | |
private String primeiroNome; | |
@Column | |
private String sobrenome; | |
@Column | |
private String email; | |
@Transient | |
private String nomeCompleto; // bom uso de transient | |
public String getNomeCompleto() { | |
if (nomeCompleto == null) { | |
nomeCompleto = primeiroNome + " " + sobrenome; | |
} | |
return nomeCompleto; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment