1 package org.hibernate.test.ops; 3 4 import java.util.Date ; 5 import java.util.HashSet ; 6 import java.util.Set ; 7 8 11 public class Node { 12 13 private String name; 14 private Node parent; 15 private Set children = new HashSet (); 16 private String description; 17 private Date created; 18 19 public Node() {} 20 21 public Node(String name) { 22 this.name = name; 23 created = new Date (); 24 } 25 26 public Set getChildren() { 27 return children; 28 } 29 public void setChildren(Set children) { 30 this.children = children; 31 } 32 public String getName() { 33 return name; 34 } 35 public void setName(String name) { 36 this.name = name; 37 } 38 public Node getParent() { 39 return parent; 40 } 41 public void setParent(Node parent) { 42 this.parent = parent; 43 } 44 45 public Node addChild(Node child) { 46 children.add(child); 47 child.setParent(this); 48 return this; 49 } 50 public String getDescription() { 51 return description; 52 } 53 public void setDescription(String description) { 54 this.description = description; 55 } 56 57 public Date getCreated() { 58 return created; 59 } 60 61 public void setCreated(Date created) { 62 this.created = created; 63 } 64 } 65 | Popular Tags |