Commit | Line | Data |
---|---|---|
ae815b9b MS |
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; | |
ae815b9b MS |
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; | |
ae815b9b MS |
15 | import javax.persistence.SequenceGenerator; |
16 | import javax.persistence.Table; | |
17 | ||
18 | /** | |
19 | * | |
20 | * @author maroni | |
21 | */ | |
22 | @Entity | |
23 | @Table(name="PERGUNTA_NODO") | |
cb7eaf54 | 24 | public class PerguntaNodo implements Serializable { |
ae815b9b MS |
25 | private static final long serialVersionUID = 1L; |
26 | @Id | |
27 | @SequenceGenerator(name="SeqPerguntaNodo", sequenceName="SQ_PERGUNTA_NODO") | |
28 | @GeneratedValue(strategy = GenerationType.AUTO, generator="SeqPerguntaNodo") | |
29 | private Long id; | |
30 | ||
31 | @Column(length=2000, nullable=false) | |
32 | private String texto; | |
33 | ||
34 | @ManyToOne | |
35 | @JoinColumn(name="nodo_id", nullable=false) | |
36 | private Nodo nodo; | |
37 | ||
cb7eaf54 | 38 | public PerguntaNodo() { |
39 | } | |
40 | ||
ae815b9b MS |
41 | public Long getId() { |
42 | return id; | |
43 | } | |
44 | ||
45 | public void setId(Long id) { | |
46 | this.id = id; | |
47 | } | |
48 | ||
cb7eaf54 | 49 | public Nodo getNodo() { |
50 | return nodo; | |
ae815b9b MS |
51 | } |
52 | ||
cb7eaf54 | 53 | public void setNodo(Nodo nodo) { |
54 | this.nodo = nodo; | |
ae815b9b MS |
55 | } |
56 | ||
57 | public String getTexto() { | |
58 | return texto; | |
59 | } | |
60 | ||
61 | public void setTexto(String texto) { | |
62 | this.texto = texto; | |
63 | } | |
64 | ||
cb7eaf54 | 65 | @Override |
66 | public boolean equals(Object obj) { | |
67 | if (obj == null) { | |
68 | return false; | |
69 | } | |
70 | if (getClass() != obj.getClass()) { | |
71 | return false; | |
72 | } | |
73 | final PerguntaNodo other = (PerguntaNodo) obj; | |
74 | if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) { | |
75 | return false; | |
76 | } | |
77 | return true; | |
ae815b9b MS |
78 | } |
79 | ||
cb7eaf54 | 80 | @Override |
81 | public int hashCode() { | |
82 | int hash = 5; | |
83 | hash = 89 * hash + (this.id != null ? this.id.hashCode() : 0); | |
84 | return hash; | |
ae815b9b MS |
85 | } |
86 | ||
7e20fa53 | 87 | @Override |
cb7eaf54 | 88 | public String toString() { |
89 | return "PerguntaNodo{" + "id=" + id + ", texto=" + texto + ", nodo=" + nodo + '}'; | |
7e20fa53 | 90 | } |
cb7eaf54 | 91 | |
ae815b9b | 92 | } |