(no commit message)
[simdecs2.git] / src / java / org / ufcspa / simdecs / entities / RespostaNodo.java
1 /*
2  * To change this template, choose Tools | Templates
3  * and open the template in the editor.
4  */
5 package org.ufcspa.simdecs.entities;
6
7 import java.io.Serializable;
8 import javax.persistence.Column;
9 import javax.persistence.Entity;
10 import javax.persistence.GeneratedValue;
11 import javax.persistence.GenerationType;
12 import javax.persistence.Id;
13 import javax.persistence.JoinColumn;
14 import javax.persistence.ManyToOne;
15 import javax.persistence.SequenceGenerator;
16 import javax.persistence.Table;
17 //
18 /**
19  *
20  * @author maroni
21  */
22 @Entity
23 @Table(name="RESPOSTA_NODO")
24 public class RespostaNodo implements Serializable {
25
26     private static final long serialVersionUID = 1L;
27
28     @Id
29     @SequenceGenerator(name="SeqRespotaNodo", sequenceName="SQ_RESPOTA_NODO")
30     @GeneratedValue(strategy = GenerationType.AUTO, generator="SeqRespotaNodo")
31     private Long id;
32     
33     @Column(nullable=false, length=2000)
34     private String texto;
35     
36     @ManyToOne
37     @JoinColumn(name="nodo_id", nullable=false)
38     private Nodo nodo;
39     
40     @ManyToOne
41     @JoinColumn(name="tabres_id", nullable=false)
42     private TabelaResposta tabelaResposta;
43
44     public Long getId() {
45         return id;
46     }
47
48     public void setId(Long id) {
49         this.id = id;
50     }
51
52     public Nodo getNodo() {
53         return nodo;
54     }
55
56     public void setNodo(Nodo nodo) {
57         this.nodo = nodo;
58     }
59
60     public String getTexto() {
61         return texto;
62     }
63
64     public void setTexto(String texto) {
65         this.texto = texto;
66     }
67
68     public TabelaResposta getTabelaResposta() {
69         return tabelaResposta;
70     }
71
72     public void setTabelaResposta(TabelaResposta tabelaResposta) {
73         this.tabelaResposta = tabelaResposta;
74     }
75
76     public RespostaNodo() {
77     }
78
79     @Override
80     public boolean equals(Object obj) {
81         if (obj == null) {
82             return false;
83         }
84         if (getClass() != obj.getClass()) {
85             return false;
86         }
87         final RespostaNodo other = (RespostaNodo) obj;
88         if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
89             return false;
90         }
91         return true;
92     }
93
94     @Override
95     public int hashCode() {
96         int hash = 7;
97         hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
98         return hash;
99     }
100
101     @Override
102     public String toString() {
103         return "RespostaNodo{" + "id=" + id + ", texto=" + texto + ", nodo=" + nodo + '}';
104     }
105
106 }