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 BayesianNetwork implements Serializable {
17 private static final long serialVersionUID = 1L;
19 @GeneratedValue(strategy = GenerationType.AUTO)
24 @OneToMany(cascade = javax.persistence.CascadeType.ALL, mappedBy = "bayesianNetwork")
25 private List<Node> nodes;
31 public void setId(Long id) {
35 public String getName() {
39 public void setName(String name) {
43 public List<Node> getNodes() {
47 public void setNodes(List<Node> nodes) {
52 public int hashCode() {
54 hash += (id != null ? id.hashCode() : 0);
59 public boolean equals(Object object) {
60 // TODO: Warning - this method won't work in the case the id fields are not set
61 if (!(object instanceof BayesianNetwork)) {
64 BayesianNetwork other = (BayesianNetwork) object;
65 if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
72 public String toString() {