Nova versao do simulador e tratamento de erros das chamadas.
[simdecs2.git] / src / java / org / ufcspa / simdecs / entities / IntervencaoPedagogica.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 java.util.Date;
9 import javax.persistence.*;
10
11 /**
12  *
13  * @author maroni
14  */
15 @Entity
16 @Table(name="Intervencao_Pedagogica", uniqueConstraints={@UniqueConstraint(columnNames={"sessao_id", "estrategia", "resultado"})})
17 public class IntervencaoPedagogica implements Serializable {
18
19     @Id
20     @SequenceGenerator(name="seqIntervencaoPedagogica", sequenceName="SQ_INTERVENCAO_PEDAGOGICA")
21     @GeneratedValue(strategy=GenerationType.AUTO, generator="seqIntervencaoPedagogica")
22     private Long id;
23     
24     @ManyToOne
25     @JoinColumn(name="sessao_id", nullable=false)
26     private SessaoUsuario sessaoUsuario;
27
28     @Column(length=100, nullable=false)
29     private String estrategia;
30
31     @Column(length=100, nullable=false)
32     private String resultado;
33     
34     @ManyToOne
35     @JoinColumn(name="tatica_id", nullable=false)
36     private TaticaPedagogica tatica;
37     
38     @Temporal(TemporalType.TIMESTAMP)
39     @Column(nullable=false)
40     private Date dataGeracao;
41     
42     @Column(nullable=false)
43     private boolean aplicada;
44
45     public boolean isAplicada() {
46         return aplicada;
47     }
48
49     public void setAplicada(boolean aplicada) {
50         this.aplicada = aplicada;
51     }
52
53     public Date getDataGeracao() {
54         return dataGeracao;
55     }
56
57     public void setDataGeracao(Date dataGeracao) {
58         this.dataGeracao = dataGeracao;
59     }
60
61     public String getEstrategia() {
62         return estrategia;
63     }
64
65     public void setEstrategia(String estrategia) {
66         this.estrategia = estrategia;
67     }
68
69     public Long getId() {
70         return id;
71     }
72
73     public void setId(Long id) {
74         this.id = id;
75     }
76
77     public String getResultado() {
78         return resultado;
79     }
80
81     public void setResultado(String resultado) {
82         this.resultado = resultado;
83     }
84
85     public SessaoUsuario getSessaoUsuario() {
86         return sessaoUsuario;
87     }
88
89     public void setSessaoUsuario(SessaoUsuario sessaoUsuario) {
90         this.sessaoUsuario = sessaoUsuario;
91     }
92
93     public TaticaPedagogica getTatica() {
94         return tatica;
95     }
96
97     public void setTatica(TaticaPedagogica tatica) {
98         this.tatica = tatica;
99     }
100
101     @Override
102     public boolean equals(Object obj) {
103         if (obj == null) {
104             return false;
105         }
106         if (getClass() != obj.getClass()) {
107             return false;
108         }
109         final IntervencaoPedagogica other = (IntervencaoPedagogica) obj;
110         if (this.sessaoUsuario != other.sessaoUsuario && (this.sessaoUsuario == null || !this.sessaoUsuario.equals(other.sessaoUsuario))) {
111             return false;
112         }
113         if ((this.estrategia == null) ? (other.estrategia != null) : !this.estrategia.equals(other.estrategia)) {
114             return false;
115         }
116         if ((this.resultado == null) ? (other.resultado != null) : !this.resultado.equals(other.resultado)) {
117             return false;
118         }
119         return true;
120     }
121
122     @Override
123     public int hashCode() {
124         int hash = 5;
125         hash = 43 * hash + (this.sessaoUsuario != null ? this.sessaoUsuario.hashCode() : 0);
126         hash = 43 * hash + (this.estrategia != null ? this.estrategia.hashCode() : 0);
127         hash = 43 * hash + (this.resultado != null ? this.resultado.hashCode() : 0);
128         return hash;
129     }
130
131     @Override
132     public String toString() {
133         return "IntervencaoPedagogica{" + "id=" + id + ", sessaoUsuario=" + sessaoUsuario + ", estrategia=" + estrategia + ", resultado=" + resultado + ", tatica=" + tatica + ", dataGeracao=" + dataGeracao + ", aplicada=" + aplicada + '}';
134     }
135
136     public IntervencaoPedagogica() {
137     }
138     
139     
140 }