fri.util.database.jpa.tree.nestedsets.pojos
Class NonUniqueNestedSetsTreePojo

java.lang.Object
  extended by fri.util.database.jpa.commons.AbstractEntity
      extended by fri.util.database.jpa.tree.nestedsets.pojos.AbstractNestedSetsTreePojo
          extended by fri.util.database.jpa.tree.nestedsets.pojos.NonUniqueNestedSetsTreePojo
All Implemented Interfaces:
NestedSetsTreeNode, TreeNode, java.lang.Cloneable

@Entity
public class NonUniqueNestedSetsTreePojo
extends AbstractNestedSetsTreePojo
implements NestedSetsTreeNode

Example POJO for the unit test, implementing NestedSetsTree via JPA. This is the same as NestedSetsTreePojo but without unique constraint on database level.

Author:
Fritz Ritzberger, 12.11.2011

Constructor Summary
NonUniqueNestedSetsTreePojo()
          No-argument constructor needed by JPA.
NonUniqueNestedSetsTreePojo(java.lang.String name)
          Convenience constructor for programming.
 
Method Summary
 NestedSetsTreeNode clone()
          For copy and unique constraint checking this is required.
 java.lang.String getAddress()
           
 java.lang.String getId()
           
 java.lang.String getName()
           
 NestedSetsTreeNode getTopLevel()
          DO NOT use this, is for the DAO exclusively.
 void setAddress(java.lang.String address)
           
 void setName(java.lang.String name)
           
 void setTopLevel(NestedSetsTreeNode topLevel)
          Do not call.
 java.lang.String toString()
           
 
Methods inherited from class fri.util.database.jpa.tree.nestedsets.pojos.AbstractNestedSetsTreePojo
getLeft, getRight, setLeft, setRight
 
Methods inherited from class fri.util.database.jpa.commons.AbstractEntity
equals, hashCode
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface fri.util.database.jpa.tree.nestedsets.NestedSetsTreeNode
getLeft, getRight, setLeft, setRight
 

Constructor Detail

NonUniqueNestedSetsTreePojo

public NonUniqueNestedSetsTreePojo()
No-argument constructor needed by JPA. Must be present when other constructors exist.


NonUniqueNestedSetsTreePojo

public NonUniqueNestedSetsTreePojo(java.lang.String name)
Convenience constructor for programming.

Method Detail

getId

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

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 top-level (root) node of this tree node. This is NOT its parent!

setTopLevel

public void setTopLevel(NestedSetsTreeNode topLevel)
Do not call. Public due to implementation constraints.

Specified by:
setTopLevel in interface NestedSetsTreeNode

getName

public java.lang.String getName()

setName

public void setName(java.lang.String name)

getAddress

public java.lang.String getAddress()

setAddress

public void setAddress(java.lang.String address)

clone

public NestedSetsTreeNode 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, excluding Id property.

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object