2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package org.ufcspa.simdecs.entities;
7 import java.io.Serializable;
9 import javax.persistence.*;
16 public class Nodo implements Serializable, IdHolder, Comparable<Nodo> {
18 public static final String SINAL_SINTOMA = "SINAL_SINTOMA";
19 public static final String HISTORICO = "HISTORICO";
20 public static final String EXAME_FISICO = "EXAME_FISICO";
21 public static final String EXAME_COMPLEMENTAR = "EXAME_COMPLEMENTAR";
22 public static final String DIAGNOSTICO = "DIAGNOSTICO";
23 public static final String CONDUTA = "CONDUTA";
26 private static final long serialVersionUID = 1L;
28 @SequenceGenerator(name="SeqNodo", sequenceName="SQ_NODO")
29 @GeneratedValue(strategy = GenerationType.AUTO, generator="SeqNodo")
32 @Column(nullable=false, length=100)
35 @Column(nullable=true, length=100)
36 private String nomeAmigavel;
38 @Column(nullable=true)
39 private Integer tempo;
41 @Column(nullable=true)
44 @Column(nullable=true, length=30)
47 @Column(nullable=true)
48 private Boolean bogus;
50 @OneToMany(cascade = javax.persistence.CascadeType.ALL, mappedBy="nodo")
51 private List<PerguntaNodo> perguntas;
54 @JoinColumn(name="rede_id", nullable=false)
61 public void setId(Long id) {
66 public boolean equals(Object obj) {
70 if (getClass() != obj.getClass()) {
73 final Nodo other = (Nodo) obj;
74 if ((this.nome == null) ? (other.nome != null) : !this.nome.equals(other.nome)) {
81 public int hashCode() {
83 hash = 17 * hash + (this.nome != null ? this.nome.hashCode() : 0);
90 public String toString() {
91 return "org.ufcspa.simdecs.entities.Nodo[ nome=" + nome + " ]";
94 public Float getCusto() {
98 public void setCusto(Float custo) {
102 public String getNome() {
106 public void setNome(String nome) {
110 public String getNomeAmigavel() {
114 public void setNomeAmigavel(String nomeAmigavel) {
115 this.nomeAmigavel = nomeAmigavel;
118 public Rede getRede() {
122 public void setRede(Rede rede) {
126 public Integer getTempo() {
130 public void setTempo(Integer tempo) {
134 public String getTipo() {
138 public void setTipo(String tipo) {
142 public Boolean getBogus() {
146 public void setBogus(Boolean bogus) {
150 public List<PerguntaNodo> getPerguntas() {
154 public void setPerguntas(List<PerguntaNodo> perguntas) {
155 this.perguntas = perguntas;
159 public int compareTo(Nodo t) {
160 return t.getId().intValue() - this.getId().intValue();