org.alfresco.repo.domain.hibernate
Class ChildAssocImpl

java.lang.Object
  extended by org.alfresco.repo.domain.hibernate.ChildAssocImpl
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, ChildAssoc

public class ChildAssocImpl
extends java.lang.Object
implements ChildAssoc, java.io.Serializable

See Also:
Serialized Form

Constructor Summary
ChildAssocImpl()
           
 
Method Summary
 void buildAssociation(Node parentNode, Node childNode)
          Performs the necessary work on the provided nodes to ensure that a bidirectional association is properly set up.
 int compareTo(ChildAssoc another)
          Orders the child associations by ID.
 boolean equals(java.lang.Object obj)
           
 Node getChild()
           
 ChildAssociationRef getChildAssocRef(QNameDAO qnameDAO)
          A convenience method to get a reference to this association.
 java.lang.String getChildNodeName()
           
 long getChildNodeNameCrc()
           
static long getCrc(QName qname)
           
 java.lang.Long getId()
           
 int getIndex()
           
 boolean getIsPrimary()
           
 Node getParent()
           
 QName getQName(QNameDAO qnameDAO)
          A convenience method to aggregate the qualified name's namespace and localname into a single qualified name.
 long getQnameCrc()
           
 java.lang.String getQnameLocalName()
           
 java.lang.Long getQnameNamespaceId()
           
 QName getTypeQName(QNameDAO qnameDAO)
          Convenience method to get the association's type
 java.lang.Long getTypeQNameId()
           
 java.lang.Long getVersion()
           
 int hashCode()
           
 void removeAssociation()
          Performs the necessary work on the parent and child nodes to maintain the inverse association sets
 void setChildNodeName(java.lang.String childNodeName)
           
 void setChildNodeNameCrc(long crc)
           
 void setIndex(int index)
          Set the index of this association
 void setIsPrimary(boolean isPrimary)
           
 void setQName(QNameDAO qnameDAO, QName qname)
          Convenience method to set the association's qname
 void setQnameCrc(long crc)
           
 void setQnameLocalName(java.lang.String qnameLocalName)
           
 void setQnameNamespaceId(java.lang.Long qnameNamespaceId)
           
 void setTypeQName(QNameDAO qnameDAO, QName typeQName)
          Convenience method to set the association's type
 void setTypeQNameId(java.lang.Long typeQNameId)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ChildAssocImpl

public ChildAssocImpl()
Method Detail

buildAssociation

public void buildAssociation(Node parentNode,
                             Node childNode)
Description copied from interface: ChildAssoc
Performs the necessary work on the provided nodes to ensure that a bidirectional association is properly set up.

The association attributes still have to be set up.

Specified by:
buildAssociation in interface ChildAssoc
See Also:
#setName(String), ChildAssoc.setIsPrimary(boolean)

removeAssociation

public void removeAssociation()
Description copied from interface: ChildAssoc
Performs the necessary work on the parent and child nodes to maintain the inverse association sets

Specified by:
removeAssociation in interface ChildAssoc

getChildAssocRef

public ChildAssociationRef getChildAssocRef(QNameDAO qnameDAO)
A convenience method to get a reference to this association.

This method is thread-safe and lazily creates the required references, if required.

Specified by:
getChildAssocRef in interface ChildAssoc
Parameters:
qnameDAO - the DAO to resolve the qname references
Returns:
Returns a reference to this association

getTypeQName

public QName getTypeQName(QNameDAO qnameDAO)
Convenience method to get the association's type

Specified by:
getTypeQName in interface ChildAssoc
Parameters:
qnameDAO - the helper DAO
Returns:
the association's type QName

setTypeQName

public void setTypeQName(QNameDAO qnameDAO,
                         QName typeQName)
Description copied from interface: ChildAssoc
Convenience method to set the association's type

Specified by:
setTypeQName in interface ChildAssoc
Parameters:
qnameDAO - the helper DAO
typeQName - the association's type QName

getQName

public QName getQName(QNameDAO qnameDAO)
A convenience method to aggregate the qualified name's namespace and localname into a single qualified name.

This method is thread-safe and lazily creates the required references, if required.

Specified by:
getQName in interface ChildAssoc
Returns:
Returns the qualified name of the association

setQName

public void setQName(QNameDAO qnameDAO,
                     QName qname)
Description copied from interface: ChildAssoc
Convenience method to set the association's qname

Specified by:
setQName in interface ChildAssoc
Parameters:
qnameDAO - the helper DAO
qname - the association's QName

getCrc

public static long getCrc(QName qname)

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()
Overrides:
toString in class java.lang.Object

compareTo

public int compareTo(ChildAssoc another)
Orders the child associations by ID. A smaller ID has a higher priority. This may change once we introduce a changeable index against which to order.

Specified by:
compareTo in interface java.lang.Comparable

getId

public java.lang.Long getId()
Specified by:
getId in interface ChildAssoc

getVersion

public java.lang.Long getVersion()
Specified by:
getVersion in interface ChildAssoc
Returns:
Return the current version number

getParent

public Node getParent()
Specified by:
getParent in interface ChildAssoc

getChild

public Node getChild()
Specified by:
getChild in interface ChildAssoc

getTypeQNameId

public java.lang.Long getTypeQNameId()
Specified by:
getTypeQNameId in interface ChildAssoc
Returns:
Returns the type of the association

setTypeQNameId

public void setTypeQNameId(java.lang.Long typeQNameId)
Specified by:
setTypeQNameId in interface ChildAssoc
Parameters:
typeQNameId - the association's dictionary type

getQnameNamespaceId

public java.lang.Long getQnameNamespaceId()
Specified by:
getQnameNamespaceId in interface ChildAssoc
Returns:
Returns the namespace of the association's local QName

setQnameNamespaceId

public void setQnameNamespaceId(java.lang.Long qnameNamespaceId)
Specified by:
setQnameNamespaceId in interface ChildAssoc
Parameters:
qnameNamespaceId - the namespace of the association's local QName

getQnameLocalName

public java.lang.String getQnameLocalName()
Specified by:
getQnameLocalName in interface ChildAssoc
Returns:
Returns the localname of the association's local QName

setQnameLocalName

public void setQnameLocalName(java.lang.String qnameLocalName)
Specified by:
setQnameLocalName in interface ChildAssoc
Parameters:
qnameLocalName - the localname of the association's local QName

getQnameCrc

public long getQnameCrc()
Specified by:
getQnameCrc in interface ChildAssoc
Returns:
Returns the crc value for the association's local QName

setQnameCrc

public void setQnameCrc(long crc)
Specified by:
setQnameCrc in interface ChildAssoc
Parameters:
crc - the crc value

getChildNodeName

public java.lang.String getChildNodeName()
Specified by:
getChildNodeName in interface ChildAssoc
Returns:
Returns the child node name. This may be truncated, in which case it will end with ...

setChildNodeName

public void setChildNodeName(java.lang.String childNodeName)
Specified by:
setChildNodeName in interface ChildAssoc
Parameters:
childNodeName - the name of the child node, which may be truncated and terminated with ... in order to not exceed 50 characters.

getChildNodeNameCrc

public long getChildNodeNameCrc()
Specified by:
getChildNodeNameCrc in interface ChildAssoc
Returns:
Returns the crc value for the child node name.

setChildNodeNameCrc

public void setChildNodeNameCrc(long crc)
Specified by:
setChildNodeNameCrc in interface ChildAssoc
Parameters:
crc - the crc value

getIsPrimary

public boolean getIsPrimary()
Specified by:
getIsPrimary in interface ChildAssoc

setIsPrimary

public void setIsPrimary(boolean isPrimary)
Specified by:
setIsPrimary in interface ChildAssoc

getIndex

public int getIndex()
Specified by:
getIndex in interface ChildAssoc
Returns:
Returns the user-assigned index

setIndex

public void setIndex(int index)
Description copied from interface: ChildAssoc
Set the index of this association

Specified by:
setIndex in interface ChildAssoc
Parameters:
index - the association index


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.