2 * To change this template, choose Tools | Templates
3 * and open the template in the editor.
5 package org.ufcspa.simdecs.bn.entity;
7 import java.io.Serializable;
9 import javax.persistence.*;
16 public class Question implements Serializable {
17 private static final long serialVersionUID = 1L;
19 @GeneratedValue(strategy = GenerationType.AUTO)
24 @OneToMany(cascade = javax.persistence.CascadeType.ALL, mappedBy = "question")
25 private List<Answer> answers;
34 public void setId(Long id) {
38 public String getText() {
42 public void setText(String text) {
46 public List<Answer> getAnswers() {
50 public void setAnswers(List<Answer> answers) {
51 this.answers = answers;
54 public Node getNode() {
58 public void setNode(Node node) {
63 public int hashCode() {
65 hash += (id != null ? id.hashCode() : 0);
70 public boolean equals(Object object) {
71 // TODO: Warning - this method won't work in the case the id fields are not set
72 if (!(object instanceof Question)) {
75 Question other = (Question) object;
76 if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
83 public String toString() {
84 return "org.ufcspa.simdecs.entity.Question[ id=" + id + " ]";