Skip to content

Instantly share code, notes, and snippets.

@victorximenis
Created June 6, 2015 19:43
Show Gist options
  • Save victorximenis/e2311ba5b231f95cc0a5 to your computer and use it in GitHub Desktop.
Save victorximenis/e2311ba5b231f95cc0a5 to your computer and use it in GitHub Desktop.
package br.unipe.dsw.entity;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Inheritance;
import javax.persistence.InheritanceType;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
public class Pessoa {
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
private Long id;
private String nome;
private String cpf;
private String email;
private String telefone;
@Embedded
private Endereco endereco;
@OneToOne
@JoinColumn(name = "usuario_id")
private Usuario usuario;
public Pessoa(long id) {
super();
this.id = id;
}
public Pessoa() {
super();
}
public Usuario getUsuario() {
return usuario;
}
public void setUsuario(Usuario usuario) {
this.usuario = usuario;
}
public Endereco getEndereco() {
return endereco;
}
public void setEndereco(Endereco endereco) {
this.endereco = endereco;
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getNome() {
return nome;
}
public void setNome(String nome) {
this.nome = nome;
}
public String getCpf() {
return cpf;
}
public void setCpf(String cpf) {
this.cpf = cpf;
}
public String getEmail() {
return email;
}
public void setEmail(String email) {
this.email = email;
}
public String getTelefone() {
return telefone;
}
public void setTelefone(String telefone) {
this.telefone = telefone;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment