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; | |
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="SINONIMO_RESPOSTA") | |
24 | public class SinonimoResposta implements Serializable { | |
25 | private static final long serialVersionUID = 1L; | |
26 | @Id | |
27 | @SequenceGenerator(name="SeqSinonimoResposta", sequenceName="SQ_SINONIMO_RESPOTA") | |
28 | @GeneratedValue(strategy = GenerationType.AUTO, generator="SeqSinonimoResposta") | |
29 | private Long id; | |
30 | ||
31 | @Column(length=2000, nullable=false) | |
32 | private String texto; | |
33 | ||
34 | @ManyToOne | |
35 | @JoinColumn(name="resn_id", nullable=false) | |
36 | private RespostaNodo resposta; | |
37 | ||
38 | public Long getId() { | |
39 | return id; | |
40 | } | |
41 | ||
42 | public void setId(Long id) { | |
43 | this.id = id; | |
44 | } | |
45 | ||
46 | @Override | |
47 | public int hashCode() { | |
48 | int hash = 0; | |
49 | hash += (id != null ? id.hashCode() : 0); | |
50 | return hash; | |
51 | } | |
52 | ||
53 | @Override | |
54 | public boolean equals(Object object) { | |
ae815b9b MS |
55 | if (!(object instanceof SinonimoResposta)) { |
56 | return false; | |
57 | } | |
58 | SinonimoResposta other = (SinonimoResposta) object; | |
59 | if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { | |
60 | return false; | |
61 | } | |
62 | return true; | |
63 | } | |
64 | ||
65 | @Override | |
66 | public String toString() { | |
67 | return "org.ufcspa.simdecs.entities.SinonimoRespota[ id=" + id + " ]"; | |
68 | } | |
69 | ||
70 | public RespostaNodo getResposta() { | |
71 | return resposta; | |
72 | } | |
73 | ||
74 | public void setResposta(RespostaNodo resposta) { | |
75 | this.resposta = resposta; | |
76 | } | |
77 | ||
78 | public String getTexto() { | |
79 | return texto; | |
80 | } | |
81 | ||
82 | public void setTexto(String texto) { | |
83 | this.texto = texto; | |
84 | } | |
85 | ||
86 | ||
87 | } |