Package org.alfresco.repo.domain.qname
Interface QNameDAO
- All Known Implementing Classes:
AbstractQNameDAOImpl,QNameDAOImpl
public interface QNameDAO
Data abstraction layer for QName and Namespace entities.
- Since:
- 3.4
- Author:
- Derek Hulley
-
Method Summary
Modifier and TypeMethodDescriptionconvertIdMapToQNameMap(Map<Long, ? extends Object> idMap) Convenience method to convert map keys from QName IDs to QNamesconvertIdsToQNames(Set<Long> ids) Bulk-convert QName IDs into QNamesconvertQNamesToIds(Set<QName> qnames, boolean create) Bulk-convert QNames into QName IDs.voiddeleteQName(QName qname) Delete a QName.getNamespace(Long id) getNamespace(String namespaceUri) getOrCreateNamespace(String namespaceUri) Get an existing instance matching the URI or create one if necessary.getOrCreateQName(QName qname) Get an existing instance matching the QName or create one if necessary.voidupdateNamespace(String oldNamespaceUri, String newNamespaceUri) Modifies an existing namespace URI.updateQName(QName qnameOld, QName qnameNew) Modify an existing QName.
-
Method Details
-
getNamespace
- Parameters:
id- the unique ID of the entity- Returns:
- the namespace pair (id, uri)
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the ID provided is invalid
-
getNamespace
- Parameters:
namespaceUri- the namespace URI to query for- Returns:
- the namespace pair (id, uri) or null if it doesn't exist
-
getOrCreateNamespace
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 pair (id, uri) or a new one
-
updateNamespace
Modifies an existing namespace URI. If the new URI already exists, then no new entity is created.- Parameters:
oldNamespaceUri- the old namespace URInewNamespaceUri- the new namespace URI- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the new namespace is in use
-
getQName
- Parameters:
id- the unique ID of the entity- Returns:
- the QName pair (id, qname) (never null)
- Throws:
org.alfresco.error.AlfrescoRuntimeException- if the ID provided is invalid
-
getQName
- Parameters:
qname- the QName to query for- Returns:
- the QName pair (id, qname) or null if it doesn't exist
-
getOrCreateQName
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:
- the QName pair (id, qname) or a new one
-
updateQName
Modify an existing QName. The ID of the new QName will be the same as the old one i.e. the old QName will cease to exist and will become the new QName. This allows QName modification without affecting tables that reference the old QName.- Parameters:
qnameOld- the old QName, which must existqnameNew- the new QName, which must not exist- Returns:
- the QName pair (id, qname) with the ID unchanged from old to new
-
deleteQName
Delete a QName. This will work only if the QName is not in use e.g. by nodes, properties, etc -
convertIdsToQNames
Bulk-convert QName IDs into QNames- Parameters:
ids- the IDs- Returns:
- the QNames for the IDs given, in the same order
-
convertIdMapToQNameMap
Convenience method to convert map keys from QName IDs to QNames- Parameters:
idMap- a map of objects keyed by QName ID- Returns:
- a map of the same objects keyed by the equivalent QNames
-
convertQNamesToIds
Bulk-convert QNames into QName IDs. This is primarily used for generating SQL IN clause lists for other DAO queries.- Parameters:
qnames- the QNames to convertcreate- true to create any missing QName entities- Returns:
- returns the QName IDs (order not guaranteed)
-