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