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.Entity; | |
9 | import javax.persistence.GeneratedValue; | |
10 | import javax.persistence.GenerationType; | |
11 | import javax.persistence.Id; | |
12 | import javax.persistence.JoinColumn; | |
13 | import javax.persistence.ManyToOne; | |
14 | import javax.persistence.SequenceGenerator; | |
15 | import javax.persistence.Table; | |
16 | ||
17 | /** | |
18 | * | |
19 | * @author maroni | |
20 | */ | |
21 | @Entity | |
22 | @Table(name="DEPENDENCIA_NODO") | |
23 | public class DependenciaNodo implements Serializable { | |
24 | private static final long serialVersionUID = 1L; | |
25 | @Id | |
26 | @SequenceGenerator(name="SeqDependenciaNodo", sequenceName="SQ_DEPENDENCIA_NODO") | |
27 | @GeneratedValue(strategy = GenerationType.AUTO, generator="SeqDependenciaNodo") | |
28 | private Long id; | |
29 | ||
30 | @ManyToOne | |
31 | @JoinColumn(name="nodo_id", nullable=false) | |
32 | private Nodo nodo; | |
33 | ||
34 | @ManyToOne | |
35 | @JoinColumn(name="nodo_dependente_id", nullable=false) | |
36 | private Nodo nodoDependente; | |
37 | ||
38 | @ManyToOne | |
39 | @JoinColumn(name="resn_id", nullable=false) | |
40 | private Nodo respostaNodo; | |
41 | ||
42 | public Long getId() { | |
43 | return id; | |
44 | } | |
45 | ||
46 | public void setId(Long id) { | |
47 | this.id = id; | |
48 | } | |
49 | ||
50 | @Override | |
51 | public int hashCode() { | |
52 | int hash = 0; | |
53 | hash += (id != null ? id.hashCode() : 0); | |
54 | return hash; | |
55 | } | |
56 | ||
57 | @Override | |
58 | public boolean equals(Object object) { | |
ae815b9b MS |
59 | if (!(object instanceof DependenciaNodo)) { |
60 | return false; | |
61 | } | |
62 | DependenciaNodo other = (DependenciaNodo) object; | |
63 | if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) { | |
64 | return false; | |
65 | } | |
66 | return true; | |
67 | } | |
68 | ||
69 | @Override | |
70 | public String toString() { | |
71 | return "org.ufcspa.simdecs.entities.DependenciaNodo[ id=" + id + " ]"; | |
72 | } | |
73 | ||
74 | public Nodo getNodo() { | |
75 | return nodo; | |
76 | } | |
77 | ||
78 | public void setNodo(Nodo nodo) { | |
79 | this.nodo = nodo; | |
80 | } | |
81 | ||
82 | public Nodo getNodoDependente() { | |
83 | return nodoDependente; | |
84 | } | |
85 | ||
86 | public void setNodoDependente(Nodo nodoDependente) { | |
87 | this.nodoDependente = nodoDependente; | |
88 | } | |
89 | ||
90 | public Nodo getRespostaNodo() { | |
91 | return respostaNodo; | |
92 | } | |
93 | ||
94 | public void setRespostaNodo(Nodo respostaNodo) { | |
95 | this.respostaNodo = respostaNodo; | |
96 | } | |
97 | ||
98 | } |