org.alfresco.repo.domain
Interface QNameDAO

All Known Implementing Classes:
HibernateQNameDAOImpl

public interface QNameDAO

Data abstraction layer for QName and Namespace entities.

Since:
2.1

Method Summary
 java.util.Map convertIdMapToQNameMap(java.util.Map idMap)
           
 java.util.Set convertIdsToQNames(java.util.Set ids)
           
 java.util.Set convertQNamesToIds(java.util.Set qnames, boolean create)
           
 NamespaceEntity getNamespaceEntity(java.lang.Long id)
           
 NamespaceEntity getNamespaceEntity(java.lang.String namespaceUri)
           
 NamespaceEntity getOrCreateNamespaceEntity(java.lang.String namespaceUri)
          Get an existing instance matching the URI or create one if necessary.
 QNameEntity getOrCreateQNameEntity(QName qname)
          Get an existing instance matching the QName or create one if necessary.
 org.alfresco.util.Pair getOrCreateQNamePair(QName qname)
           
 QName getQName(java.lang.Long id)
           
 QNameEntity getQNameEntity(java.lang.Long id)
           
 QNameEntity getQNameEntity(QName qname)
           
 NamespaceEntity newNamespaceEntity(java.lang.String namespaceUri)
           
 QNameEntity newQNameEntity(QName qname)
           
 void updateNamespaceEntity(java.lang.String oldNamespaceUri, java.lang.String newNamespaceUri)
          Modifies an existing namespace URI.
 

Method Detail

getNamespaceEntity

NamespaceEntity getNamespaceEntity(java.lang.Long id)
Parameters:
id - the unique ID of the entity
Returns:
the namespace entity (never null)
Throws:
org.alfresco.error.AlfrescoRuntimeException - if the ID provided is invalid

getNamespaceEntity

NamespaceEntity getNamespaceEntity(java.lang.String namespaceUri)
Parameters:
namespaceUri - the namespace URI to query for
Returns:
the namespace entity of null if it doesn't exist

getOrCreateNamespaceEntity

NamespaceEntity getOrCreateNamespaceEntity(java.lang.String namespaceUri)
Get an existing instance matching the URI or create one if necessary. Note that this method should be treated as a write method and should not be used in the context of read-only or query methods.

Parameters:
namespaceUri - the namespace URI to create
Returns:
the existing namespace entity if found or a new one

newNamespaceEntity

NamespaceEntity newNamespaceEntity(java.lang.String namespaceUri)
Parameters:
namespaceUri - the namespace URI to create
Returns:
Returns the new instance

updateNamespaceEntity

void updateNamespaceEntity(java.lang.String oldNamespaceUri,
                           java.lang.String newNamespaceUri)
Modifies an existing namespace URI. If the new URI already exists, then no new entity is created and a concurrency

Parameters:
oldNamespaceUri - the old namespace URI
newNamespaceUri - the new namespace URI
Throws:
org.alfresco.error.AlfrescoRuntimeException - if the new namespace is in use

getQNameEntity

QNameEntity getQNameEntity(java.lang.Long id)
Parameters:
id - the unique ID of the entity
Returns:
the QName entity (never null)
Throws:
org.alfresco.error.AlfrescoRuntimeException - if the ID provided is invalid

getQName

QName getQName(java.lang.Long id)
Parameters:
id - the unique ID of the entity
Returns:
the QName (never null)
Throws:
org.alfresco.error.AlfrescoRuntimeException - if the ID provided is invalid

getQNameEntity

QNameEntity getQNameEntity(QName qname)
Parameters:
qname - the QName to query for
Returns:
the QName entity of null if it doesn't exist

getOrCreateQNameEntity

QNameEntity getOrCreateQNameEntity(QName qname)
Get an existing instance matching the QName or create one if necessary. Note that this method should be treated as a write method and should not be used in the context of read-only or query methods.

Parameters:
qname - the QName to query for
Returns:
an existing QName entity if found or a new one

getOrCreateQNamePair

org.alfresco.util.Pair getOrCreateQNamePair(QName qname)

newQNameEntity

QNameEntity newQNameEntity(QName qname)
Parameters:
qname - the QName to create
Returns:
the new instance

convertIdsToQNames

java.util.Set convertIdsToQNames(java.util.Set ids)

convertIdMapToQNameMap

java.util.Map convertIdMapToQNameMap(java.util.Map idMap)

convertQNamesToIds

java.util.Set convertQNamesToIds(java.util.Set qnames,
                                 boolean create)


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