package banco.modelo; import java.io.Serializable; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.OneToOne; import javax.validation.constraints.NotNull; import aplicacao.helper.FileHelper; @Entity public class Configuracao implements Serializable{ private static final long serialVersionUID = 5712072341645546025L; public static String pastaLogo = FileHelper.directoryPath("logo"); @Id @GeneratedValue(strategy=GenerationType.IDENTITY) private Long id; @Column private String logoEmpresa; @OneToOne @NotNull(message="Selecione o representante da empresa") private Pessoa representanteEmpresa; public Pessoa getRepresentanteEmpresa() { return representanteEmpresa; } public void setRepresentanteEmpresa(Pessoa representanteEmpresa) { this.representanteEmpresa = representanteEmpresa; } @Override public int hashCode() { final int prime = 31; int result = 1; result = prime * result + ((id == null) ? 0 : id.hashCode()); return result; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; Configuracao other = (Configuracao) obj; if (id == null) { if (other.id != null) return false; } else if (!id.equals(other.id)) return false; return true; } public Long getId() { return id; } public void setId(Long id) { this.id = id; } public String getLogoEmpresa() { return logoEmpresa; } public void setLogoEmpresa(String logoEmpresa) { this.logoEmpresa = logoEmpresa; } }