Created
June 6, 2015 19:43
-
-
Save victorximenis/e2311ba5b231f95cc0a5 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
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