org.jboss.dna.connector.store.jpa.model.basic
Class ChildEntity

java.lang.Object
  extended by org.jboss.dna.connector.store.jpa.model.basic.ChildEntity

public class ChildEntity
extends Object

An entity representing the parent-child relationship between two nodes. In addition to the references to the parent and child nodes, this entity also maintains the indexInParent of the indexInParent within the parent node's list of all children, the child's name ( local part and namespace), and the same-name-sibling indexInParent (if there is one).


Constructor Summary
ChildEntity()
           
ChildEntity(ChildId id, String parentUuidString, int indexInParent, NamespaceEntity ns, String name)
           
ChildEntity(ChildId id, String parentUuidString, int indexInParent, NamespaceEntity ns, String name, int sameNameSiblingIndex)
           
 
Method Summary
static int adjustSnsIndexesAndIndexes(javax.persistence.EntityManager entities, Long workspaceId, String uuidParent, int afterIndex, int untilIndex, long childNamespaceIndex, String childName, int modifier)
           
static void adjustSnsIndexesAndIndexesAfterRemoving(javax.persistence.EntityManager entities, Long workspaceId, String uuidParent, String childName, long childNamespaceIndex, int childIndex)
           
 boolean equals(Object obj)
          
 boolean getAllowsSameNameChildren()
           
 String getChildName()
           
 NamespaceEntity getChildNamespace()
           
 ChildId getId()
           
 int getIndexInParent()
          Get the zero-based index of this child within the parent's list of children
 String getParentUuidString()
          Returns the parent UUID string
 int getSameNameSiblingIndex()
           
 int hashCode()
          
 void setAllowsSameNameChildren(boolean allowsSameNameChildren)
           
 void setChildName(String childName)
           
 void setChildNamespace(NamespaceEntity childNamespace)
           
 void setId(ChildId childId)
           
 void setIndexInParent(int index)
           
 void setParentUuidString(String parentUuidString)
          Sets the parent UUID string
 void setSameNameSiblingIndex(int sameNameSiblingIndex)
           
 String toString()
          
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChildEntity

public ChildEntity()

ChildEntity

public ChildEntity(ChildId id,
                   String parentUuidString,
                   int indexInParent,
                   NamespaceEntity ns,
                   String name)

ChildEntity

public ChildEntity(ChildId id,
                   String parentUuidString,
                   int indexInParent,
                   NamespaceEntity ns,
                   String name,
                   int sameNameSiblingIndex)
Method Detail

getId

public ChildId getId()
Returns:
parent

setId

public void setId(ChildId childId)
Parameters:
childId - Sets parent to the specified value.

getParentUuidString

public String getParentUuidString()
Returns the parent UUID string

Returns:
the parent UUID string

setParentUuidString

public void setParentUuidString(String parentUuidString)
Sets the parent UUID string

Parameters:
parentUuidString - the parent UUID string

getIndexInParent

public int getIndexInParent()
Get the zero-based index of this child within the parent's list of children

Returns:
the zero-based index of this child

setIndexInParent

public void setIndexInParent(int index)
Parameters:
index - Sets indexInParent to the specified value.

getChildName

public String getChildName()
Returns:
childName

setChildName

public void setChildName(String childName)
Parameters:
childName - Sets childName to the specified value.

getChildNamespace

public NamespaceEntity getChildNamespace()
Returns:
childNamespace

setChildNamespace

public void setChildNamespace(NamespaceEntity childNamespace)
Parameters:
childNamespace - Sets childNamespace to the specified value.

getSameNameSiblingIndex

public int getSameNameSiblingIndex()
Returns:
sameNameSiblingIndex

setSameNameSiblingIndex

public void setSameNameSiblingIndex(int sameNameSiblingIndex)
Parameters:
sameNameSiblingIndex - Sets sameNameSiblingIndex to the specified value.

getAllowsSameNameChildren

public boolean getAllowsSameNameChildren()
Returns:
allowsSameNameChildren

setAllowsSameNameChildren

public void setAllowsSameNameChildren(boolean allowsSameNameChildren)
Parameters:
allowsSameNameChildren - Sets allowsSameNameChildren to the specified value.

hashCode

public int hashCode()

Overrides:
hashCode in class Object
See Also:
Object.hashCode()

equals

public boolean equals(Object obj)

Overrides:
equals in class Object
See Also:
Object.equals(java.lang.Object)

toString

public String toString()

Overrides:
toString in class Object
See Also:
Object.toString()

adjustSnsIndexesAndIndexesAfterRemoving

public static void adjustSnsIndexesAndIndexesAfterRemoving(javax.persistence.EntityManager entities,
                                                           Long workspaceId,
                                                           String uuidParent,
                                                           String childName,
                                                           long childNamespaceIndex,
                                                           int childIndex)

adjustSnsIndexesAndIndexes

public static int adjustSnsIndexesAndIndexes(javax.persistence.EntityManager entities,
                                             Long workspaceId,
                                             String uuidParent,
                                             int afterIndex,
                                             int untilIndex,
                                             long childNamespaceIndex,
                                             String childName,
                                             int modifier)


Copyright © 2008-2009 JBoss, a division of Red Hat. All Rights Reserved.