fri.util.database.jpa.tree.examples.nestedsets.temporal
Class PersonTnst

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

@Entity
public class PersonTnst
extends java.lang.Object
implements TemporalNestedSetsTreeNode

Example temporal entity, Tnst = Temporal Nested Sets Tree, redirecting validTo to endValid, and validFrom to nothing, as validTo is enough to support historization.


Field Summary
 
Fields inherited from interface fri.util.database.jpa.tree.Temporal
VALID_FROM, VALID_TO
 
Constructor Summary
PersonTnst()
           
PersonTnst(java.lang.String name)
           
 
Method Summary
 PersonTnst clone()
          For copy and unique constraint checking this is required.
 boolean equals(java.lang.Object obj)
           
 java.util.Date getEndValid()
           
 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.
 java.util.Date getValidFrom()
           
 java.util.Date getValidTo()
           
 int hashCode()
           
 void setEndValid(java.util.Date endValid)
           
 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.
 void setValidFrom(java.util.Date validFrom)
          Sets the temporal valid-from date of this node.
 void setValidTo(java.util.Date validTo)
          Sets the temporal valid-to date of this node.
 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

PersonTnst

public PersonTnst()

PersonTnst

public PersonTnst(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)

getEndValid

public java.util.Date getEndValid()

setEndValid

public void setEndValid(java.util.Date endValid)

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 PersonTnst 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).

getValidTo

public java.util.Date getValidTo()
Specified by:
getValidTo in interface Temporal
Returns:
the temporal valid-to date of this node.

setValidTo

public void setValidTo(java.util.Date validTo)
Description copied from interface: Temporal
Sets the temporal valid-to date of this node.

Specified by:
setValidTo in interface Temporal

getValidFrom

public java.util.Date getValidFrom()
Specified by:
getValidFrom in interface Temporal
Returns:
the temporal valid-from date of this node.

setValidFrom

public void setValidFrom(java.util.Date validFrom)
Description copied from interface: Temporal
Sets the temporal valid-from date of this node.

Specified by:
setValidFrom in interface Temporal

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