fri.util.database.jpa.tree.examples.nestedsets
Class PersonNst

java.lang.Object
  extended by fri.util.database.jpa.tree.examples.nestedsets.PersonNst
All Implemented Interfaces:
NestedSetsTreeNode, TreeNode, java.lang.Cloneable

@Entity
public class PersonNst
extends java.lang.Object
implements NestedSetsTreeNode

Example entity, Nst = Nested Sets Tree.


Constructor Summary
PersonNst()
           
PersonNst(java.lang.String name)
           
 
Method Summary
 PersonNst clone()
          For copy and unique constraint checking this is required.
 boolean equals(java.lang.Object obj)
           
 java.lang.String getId()
           
 int getLeft()
          DO NOT use this, is for the DAO exclusively.
 java.lang.String getName()
           
 int getRight()
          DO NOT use this, is for the DAO exclusively.
 NestedSetsTreeNode getTopLevel()
          DO NOT use this, is for the DAO exclusively.
 int hashCode()
           
 void setLeft(int left)
          DO NOT use this, is for the DAO exclusively.
 void setName(java.lang.String name)
           
 void setRight(int right)
          DO NOT use this, is for the DAO exclusively.
 void setTopLevel(NestedSetsTreeNode topLevel)
          DO NOT use this, is for the DAO exclusively.
 java.lang.String toString()
          Overridden to avoid super.toString() calling hashCode(), as this might throw exception when no id exists yet.
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersonNst

public PersonNst()

PersonNst

public PersonNst(java.lang.String name)
Method Detail

getId

public java.lang.String getId()
Specified by:
getId in interface TreeNode
Returns:
the primary key of this tree node.

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getTopLevel

public NestedSetsTreeNode getTopLevel()
Description copied from interface: NestedSetsTreeNode
DO NOT use this, is for the DAO exclusively. The private Java property name for this MUST BE "topLevel" in any implementation, as that name is used in DAO queries.

Specified by:
getTopLevel in interface NestedSetsTreeNode
Returns:
the root node of this tree node (root and topLevel are synonyms).

setTopLevel

public void setTopLevel(NestedSetsTreeNode topLevel)
Description copied from interface: NestedSetsTreeNode
DO NOT use this, is for the DAO exclusively. Sets the top-level root of this tree node.

Specified by:
setTopLevel in interface NestedSetsTreeNode

getLeft

public int getLeft()
Description copied from interface: NestedSetsTreeNode
DO NOT use this, is for the DAO exclusively. The private Java property name for this MUST BE "lft" in any implementation, as that name is used in DAO queries.

Specified by:
getLeft in interface NestedSetsTreeNode
Returns:
the left order number.

setLeft

public void setLeft(int left)
Description copied from interface: NestedSetsTreeNode
DO NOT use this, is for the DAO exclusively. Sets the left order number.

Specified by:
setLeft in interface NestedSetsTreeNode

getRight

public int getRight()
Description copied from interface: NestedSetsTreeNode
DO NOT use this, is for the DAO exclusively. The private Java property name for this MUST BE "rgt" in any implementation, as that name is used in DAO queries.

Specified by:
getRight in interface NestedSetsTreeNode
Returns:
the right order number.

setRight

public void setRight(int right)
Description copied from interface: NestedSetsTreeNode
DO NOT use this, is for the DAO exclusively. Sets the right order number.

Specified by:
setRight in interface NestedSetsTreeNode

clone

public PersonNst clone()
Description copied from interface: NestedSetsTreeNode
For copy and unique constraint checking this is required.

Specified by:
clone in interface NestedSetsTreeNode
Specified by:
clone in interface TreeNode
Overrides:
clone in class java.lang.Object
Returns:
a clone of this node, not including the "id" property (which is set by the JPA layer).

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overridden to avoid super.toString() calling hashCode(), as this might throw exception when no id exists yet.

Overrides:
toString in class java.lang.Object