<non-jta-data-source>jdbc/SimDeCS</non-jta-data-source>
<class>org.ufcspa.simdecs.entities.Caso</class>
<class>org.ufcspa.simdecs.entities.DependenciaNodo</class>
+ <class>org.ufcspa.simdecs.entities.IntervaloTabelaRespota</class>
<class>org.ufcspa.simdecs.entities.Log</class>
<class>org.ufcspa.simdecs.entities.Nodo</class>
<class>org.ufcspa.simdecs.entities.NodoPaciente</class>
<class>org.ufcspa.simdecs.entities.RespostaNodo</class>
<class>org.ufcspa.simdecs.entities.SessaoUsuario</class>
<class>org.ufcspa.simdecs.entities.SinonimoResposta</class>
+ <class>org.ufcspa.simdecs.entities.TabelaResposta</class>
<class>org.ufcspa.simdecs.entities.TipoEventoLog</class>
<class>org.ufcspa.simdecs.entities.Usuario</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>
--- /dev/null
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.ufcspa.simdecs.entities;
+
+import java.io.Serializable;
+import javax.persistence.*;
+
+/**
+ *
+ * @author maroni
+ */
+@Entity
+@Table(name="INTERVALO_TABELA_REPOSTA")
+public class IntervaloTabelaRespota implements Serializable {
+ private static final long serialVersionUID = 1L;
+ @Id
+ @SequenceGenerator(name="seqIntervaloTabelaResposta", sequenceName="SQ_INTERVALO_TABELA_RESPOSTA")
+ @GeneratedValue(strategy = GenerationType.AUTO, generator="seqIntervaloTabelaResposta")
+ private Long id;
+
+ @ManyToOne
+ @JoinColumn(name="tabres_id", nullable=false)
+ private TabelaResposta tabelaResposta;
+
+ @Column(nullable=false, length=3)
+ private Integer pesoMinimo;
+
+ @Column(nullable=false, length=3)
+ private Integer pesoMaximo;
+
+ @Column(nullable=false, length=2000)
+ private String texto;
+
+ public TabelaResposta getTabelaResposta() {
+ return tabelaResposta;
+ }
+
+ public void setTabelaResposta(TabelaResposta tabelaResposta) {
+ this.tabelaResposta = tabelaResposta;
+ }
+
+ public Integer getPesoMaximo() {
+ return pesoMaximo;
+ }
+
+ public void setPesoMaximo(Integer pesoMaximo) {
+ this.pesoMaximo = pesoMaximo;
+ }
+
+ public Integer getPesoMinimo() {
+ return pesoMinimo;
+ }
+
+ public void setPesoMinimo(Integer pesoMinimo) {
+ this.pesoMinimo = pesoMinimo;
+ }
+
+ public String getTexto() {
+ return texto;
+ }
+
+ public void setTexto(String texto) {
+ this.texto = texto;
+ }
+
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+ @Override
+ public int hashCode() {
+ int hash = 0;
+ hash += (id != null ? id.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ // TODO: Warning - this method won't work in the case the id fields are not set
+ if (!(object instanceof IntervaloTabelaRespota)) {
+ return false;
+ }
+ IntervaloTabelaRespota other = (IntervaloTabelaRespota) object;
+ if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "org.ufcspa.simdecs.entities.IntervaloTabelaRespota[ id=" + id + " ]";
+ }
+
+}
package org.ufcspa.simdecs.entities;
import java.io.Serializable;
-import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
*/
@Entity
@Table(name="PERGUNTA_NODO")
-public class PerguntaNodo implements Serializable, IdHolder, Comparable<PerguntaNodo> {
+public class PerguntaNodo implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@SequenceGenerator(name="SeqPerguntaNodo", sequenceName="SQ_PERGUNTA_NODO")
@JoinColumn(name="nodo_id", nullable=false)
private Nodo nodo;
- @OneToMany(cascade = javax.persistence.CascadeType.ALL, mappedBy="pergunta")
- private List<RespostaNodo> respostas;
-
+ public PerguntaNodo() {
+ }
+
public Long getId() {
return id;
}
this.id = id;
}
- @Override
- public int hashCode() {
- int hash = 0;
- hash += (id != null ? id.hashCode() : 0);
- return hash;
- }
-
- @Override
- public boolean equals(Object object) {
- // TODO: Warning - this method won't work in the case the id fields are not set
- if (!(object instanceof PerguntaNodo)) {
- return false;
- }
- PerguntaNodo other = (PerguntaNodo) object;
- if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
- return false;
- }
- return true;
+ public Nodo getNodo() {
+ return nodo;
}
- @Override
- public String toString() {
- return "org.ufcspa.simdecs.entities.PerguntaNodo[ id=" + id + " ]";
+ public void setNodo(Nodo nodo) {
+ this.nodo = nodo;
}
public String getTexto() {
this.texto = texto;
}
- public Nodo getNodo() {
- return nodo;
- }
-
- public void setNodo(Nodo nodo) {
- this.nodo = nodo;
- }
-
- public List<RespostaNodo> getRespostas() {
- return respostas;
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final PerguntaNodo other = (PerguntaNodo) obj;
+ if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
+ return false;
+ }
+ return true;
}
- public void setRespostas(List<RespostaNodo> respostas) {
- this.respostas = respostas;
+ @Override
+ public int hashCode() {
+ int hash = 5;
+ hash = 89 * hash + (this.id != null ? this.id.hashCode() : 0);
+ return hash;
}
@Override
- public int compareTo(PerguntaNodo t) {
- return t.getId().intValue()- this.getId().intValue();
+ public String toString() {
+ return "PerguntaNodo{" + "id=" + id + ", texto=" + texto + ", nodo=" + nodo + '}';
}
-
+
}
package org.ufcspa.simdecs.entities;
import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
-import javax.persistence.OneToMany;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
//
*/
@Entity
@Table(name="RESPOSTA_NODO")
-public class RespostaNodo implements Serializable, IdHolder, Comparable<RespostaNodo> {
+public class RespostaNodo implements Serializable {
+
private static final long serialVersionUID = 1L;
+
@Id
- @SequenceGenerator(name="SeqRespotaNOdo", sequenceName="SQ_RESPOTA_NODO")
- @GeneratedValue(strategy = GenerationType.AUTO)
+ @SequenceGenerator(name="SeqRespotaNodo", sequenceName="SQ_RESPOTA_NODO")
+ @GeneratedValue(strategy = GenerationType.AUTO, generator="SeqRespotaNodo")
private Long id;
- @Column(nullable=false, length=3)
- private Integer pesoMinimo;
-
- @Column(nullable=false, length=3)
- private Integer pesoMaximo;
-
- @ManyToOne
- @JoinColumn(name="pergunta_id", nullable=false)
- private PerguntaNodo pergunta;
+ @Column(nullable=false, length=2000)
+ private String texto;
- @OneToMany(cascade = javax.persistence.CascadeType.ALL, mappedBy="resposta")
- private List<SinonimoResposta> sinonimos;
+ @ManyToOne
+ @JoinColumn(name="nodo_id", nullable=false)
+ private Nodo nodo;
- @Column(nullable=true, length=2000)
- private String texto;
+ @ManyToOne
+ @JoinColumn(name="tabres_id", nullable=false)
+ private TabelaResposta tabelaResposta;
public Long getId() {
return id;
this.id = id;
}
- @Override
- public int hashCode() {
- int hash = 0;
- hash += (id != null ? id.hashCode() : 0);
- return hash;
+ public Nodo getNodo() {
+ return nodo;
}
- @Override
- public boolean equals(Object object) {
- // TODO: Warning - this method won't work in the case the id fields are not set
- if (!(object instanceof RespostaNodo)) {
- return false;
- }
- RespostaNodo other = (RespostaNodo) object;
- if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
- return false;
- }
- return true;
+ public void setNodo(Nodo nodo) {
+ this.nodo = nodo;
}
- @Override
- public String toString() {
- return "org.ufcspa.simdecs.entities.RespostaNodo[ id=" + id + " ]";
+ public String getTexto() {
+ return texto;
}
- public Integer getPesoMaximo() {
- return pesoMaximo;
+ public void setTexto(String texto) {
+ this.texto = texto;
}
- public void setPesoMaximo(Integer pesoMaximo) {
- this.pesoMaximo = pesoMaximo;
+ public TabelaResposta getTabelaResposta() {
+ return tabelaResposta;
}
- public Integer getPesoMinimo() {
- return pesoMinimo;
+ public void setTabelaResposta(TabelaResposta tabelaResposta) {
+ this.tabelaResposta = tabelaResposta;
}
- public void setPesoMinimo(Integer pesoMinimo) {
- this.pesoMinimo = pesoMinimo;
+ public RespostaNodo() {
}
- public PerguntaNodo getPergunta() {
- return pergunta;
+ @Override
+ public boolean equals(Object obj) {
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final RespostaNodo other = (RespostaNodo) obj;
+ if (this.id != other.id && (this.id == null || !this.id.equals(other.id))) {
+ return false;
+ }
+ return true;
}
- public void setPergunta(PerguntaNodo pergunta) {
- this.pergunta = pergunta;
+ @Override
+ public int hashCode() {
+ int hash = 7;
+ hash = 67 * hash + (this.id != null ? this.id.hashCode() : 0);
+ return hash;
}
-
- public List<SinonimoResposta> getSinonimos() {
- return sinonimos;
+ @Override
+ public String toString() {
+ return "RespostaNodo{" + "id=" + id + ", texto=" + texto + ", nodo=" + nodo + '}';
}
- public void setSinonimos(List<SinonimoResposta> sinonimos) {
- this.sinonimos = sinonimos;
- }
-
- public void setTexto(String texto) {
- this.texto = texto;
- }
-
- public String getTexto(){
- return this.texto;
- }
-
- @Override
- public int compareTo(RespostaNodo t) {
- return t.getId().intValue() - this.getId().intValue();
- }
}
--- /dev/null
+/*
+ * To change this template, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.ufcspa.simdecs.entities;
+
+import java.io.Serializable;
+import javax.persistence.*;
+
+/**
+ *
+ * @author maroni
+ */
+@Entity
+@Table(name="TABELA_RESPOSTA")
+public class TabelaResposta implements Serializable {
+
+ private static final long serialVersionUID = 1L;
+ @Id
+ @SequenceGenerator(name="seqTabelaResposta", sequenceName="SQ_TABELA_RESPOSTA")
+ @GeneratedValue(strategy = GenerationType.AUTO, generator="seqTabelaResposta")
+ private Long id;
+
+ @Column(nullable=false, length=100)
+ private String nome;
+
+ public String getNome() {
+ return nome;
+ }
+
+ public void setNome(String nome) {
+ this.nome = nome;
+ }
+
+ public Long getId() {
+ return id;
+ }
+
+ public void setId(Long id) {
+ this.id = id;
+ }
+
+
+
+ @Override
+ public int hashCode() {
+ int hash = 0;
+ hash += (id != null ? id.hashCode() : 0);
+ return hash;
+ }
+
+ @Override
+ public boolean equals(Object object) {
+ // TODO: Warning - this method won't work in the case the id fields are not set
+ if (!(object instanceof TabelaResposta)) {
+ return false;
+ }
+ TabelaResposta other = (TabelaResposta) object;
+ if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "org.ufcspa.simdecs.entities.TabelaResposta[ id=" + id + " ]";
+ }
+
+}
public PerguntaNodo getSelectedPergunta() {
return selectedPergunta;
}
-
+/*
public SimdecsDataModel getSelectablePerguntas() {
if (selectedNodo != null && selectedNodo.getPerguntas() != null) {
Collections.sort(selectedNodo.getPerguntas());
return new SimdecsDataModel(new ArrayList());
}
}
-
+*/
public RespostaNodo getSelectedResposta() {
return selectedResposta;
}
public void setSelectedResposta(RespostaNodo selectedResposta) {
this.selectedResposta = selectedResposta;
}
-
+/*
public void addPergunta() {
if (selectedNodo != null) {
try {
}
}
-
+*/
public void removePergunta(PerguntaNodo pergunta) {
try {
em.getTransaction().begin();
}
addInfoMessage("Pergunta Removida", "Pergunta removida com sucesso.");
}
-
+/*
public void addResposta() {
if (selectedPergunta != null) {
try {
}
addInfoMessage("Resposta removida", "Resposta removida com sucesso.");
}
-
+*/
public void addNodo() {
if (rede != null) {
try {