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 NumberedNode { 12 13 private long id; 14 private String name; 15 private NumberedNode parent; 16 private Set children = new HashSet (); 17 private String description; 18 private Date created; 19 20 public NumberedNode() { 21 super(); 22 } 23 24 public NumberedNode(String name) { 25 this.name = name; 26 created = new Date (); 27 } 28 29 public long getId() { 30 return id; 31 } 32 public void setId(long id) { 33 this.id = id; 34 } 35 36 public Set getChildren() { 37 return children; 38 } 39 public void setChildren(Set children) { 40 this.children = children; 41 } 42 public String getName() { 43 return name; 44 } 45 public void setName(String name) { 46 this.name = name; 47 } 48 public NumberedNode getParent() { 49 return parent; 50 } 51 public void setParent(NumberedNode parent) { 52 this.parent = parent; 53 } 54 55 public NumberedNode addChild(NumberedNode child) { 56 children.add(child); 57 child.setParent(this); 58 return this; 59 } 60 61 public String getDescription() { 62 return description; 63 } 64 public void setDescription(String description) { 65 this.description = description; 66 } 67 68 public Date getCreated() { 69 return created; 70 } 71 72 public void setCreated(Date created) { 73 this.created = created; 74 } 75 } 76 | Popular Tags |