1
//$Id: Node.java 10760 2006-11-08 00:01:34Z steve.ebersole@jboss.com $
2
package org.hibernate.test.ops;
5
import java.util.HashSet;
14
private String description;
17
private Set children = new HashSet();
18
private Set cascadingChildren = new HashSet();
23
public Node(String name) {
25
created = generateCurrentDate();
28
public String getName() {
32
public void setName(String name) {
36
public String getDescription() {
40
public void setDescription(String description) {
41
this.description = description;
44
public Date getCreated() {
48
public void setCreated(Date created) {
49
this.created = created;
52
public Node getParent() {
56
public void setParent(Node parent) {
60
public Set getChildren() {
64
public void setChildren(Set children) {
65
this.children = children;
68
public Node addChild(Node child) {
69
children.add( child );
70
child.setParent( this );
74
public Set getCascadingChildren() {
75
return cascadingChildren;
78
public void setCascadingChildren(Set cascadingChildren) {
79
this.cascadingChildren = cascadingChildren;
82
private Date generateCurrentDate() {
83
// Note : done as java.sql.Date mainly to work around issue with
84
// MySQL and its lack of milli-second precision on its DATETIME
85
// and TIMESTAMP datatypes.
86
return new Date( new java.util.Date().getTime() );