public abstract class AbstractQNameDAOImpl extends Object implements QNameDAO
Modifier | Constructor and Description |
---|---|
protected |
AbstractQNameDAOImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
Map<org.alfresco.service.namespace.QName,? extends Object> |
convertIdMapToQNameMap(Map<Long,? extends Object> idMap)
Convenience method to convert map keys from QName IDs to QNames
|
Set<org.alfresco.service.namespace.QName> |
convertIdsToQNames(Set<Long> ids)
Bulk-convert QName IDs into QNames
|
Set<Long> |
convertQNamesToIds(Set<org.alfresco.service.namespace.QName> qnames,
boolean create)
Bulk-convert QNames into QName IDs.
|
protected abstract NamespaceEntity |
createNamespaceEntity(String uri) |
protected abstract QNameEntity |
createQNameEntity(Long nsId,
String localName) |
void |
deleteQName(org.alfresco.service.namespace.QName qname)
Delete a QName.
|
protected abstract int |
deleteQNameEntity(QNameEntity entity) |
protected abstract NamespaceEntity |
findNamespaceEntityById(Long id) |
protected abstract NamespaceEntity |
findNamespaceEntityByUri(String uri) |
protected abstract QNameEntity |
findQNameEntityById(Long id) |
protected abstract QNameEntity |
findQNameEntityByNamespaceAndLocalName(Long nsId,
String localName) |
org.alfresco.util.Pair<Long,String> |
getNamespace(Long id) |
org.alfresco.util.Pair<Long,String> |
getNamespace(String namespaceUri) |
org.alfresco.util.Pair<Long,String> |
getOrCreateNamespace(String namespaceUri)
Get an existing instance matching the URI or create one if necessary.
|
org.alfresco.util.Pair<Long,org.alfresco.service.namespace.QName> |
getOrCreateQName(org.alfresco.service.namespace.QName qname)
Get an existing instance matching the QName or create one if necessary.
|
org.alfresco.util.Pair<Long,org.alfresco.service.namespace.QName> |
getQName(Long id) |
org.alfresco.util.Pair<Long,org.alfresco.service.namespace.QName> |
getQName(org.alfresco.service.namespace.QName qname) |
void |
setNamespaceCache(org.alfresco.repo.cache.SimpleCache<Long,String> namespaceCache)
Set the cache that maintains the ID-Namespace mappings and vice-versa.
|
void |
setQnameCache(org.alfresco.repo.cache.SimpleCache<Long,org.alfresco.service.namespace.QName> qnameCache)
Set the cache that maintains the ID-Namespace mappings and vice-versa.
|
void |
updateNamespace(String oldNamespaceUri,
String newNamespaceUri)
Modifies an existing namespace URI.
|
protected abstract int |
updateNamespaceEntity(NamespaceEntity entity,
String uri) |
org.alfresco.util.Pair<Long,org.alfresco.service.namespace.QName> |
updateQName(org.alfresco.service.namespace.QName qnameOld,
org.alfresco.service.namespace.QName qnameNew)
Modify an existing QName.
|
protected abstract int |
updateQNameEntity(QNameEntity entity,
Long nsId,
String localName) |
protected AbstractQNameDAOImpl()
This sets up the DAO accessors to bypass any caching to handle the case where the caches are not supplied in the setters.
public void setNamespaceCache(org.alfresco.repo.cache.SimpleCache<Long,String> namespaceCache)
namespaceCache
- the cachepublic void setQnameCache(org.alfresco.repo.cache.SimpleCache<Long,org.alfresco.service.namespace.QName> qnameCache)
qnameCache
- the cachepublic org.alfresco.util.Pair<Long,String> getNamespace(Long id)
getNamespace
in interface QNameDAO
id
- the unique ID of the entitypublic org.alfresco.util.Pair<Long,String> getNamespace(String namespaceUri)
getNamespace
in interface QNameDAO
namespaceUri
- the namespace URI to query forpublic org.alfresco.util.Pair<Long,String> getOrCreateNamespace(String namespaceUri)
QNameDAO
getOrCreateNamespace
in interface QNameDAO
namespaceUri
- the namespace URI to createpublic void updateNamespace(String oldNamespaceUri, String newNamespaceUri)
QNameDAO
updateNamespace
in interface QNameDAO
oldNamespaceUri
- the old namespace URInewNamespaceUri
- the new namespace URIprotected abstract NamespaceEntity findNamespaceEntityById(Long id)
protected abstract NamespaceEntity findNamespaceEntityByUri(String uri)
protected abstract NamespaceEntity createNamespaceEntity(String uri)
protected abstract int updateNamespaceEntity(NamespaceEntity entity, String uri)
public org.alfresco.util.Pair<Long,org.alfresco.service.namespace.QName> getQName(org.alfresco.service.namespace.QName qname)
public org.alfresco.util.Pair<Long,org.alfresco.service.namespace.QName> getOrCreateQName(org.alfresco.service.namespace.QName qname)
QNameDAO
getOrCreateQName
in interface QNameDAO
qname
- the QName to query forpublic org.alfresco.util.Pair<Long,org.alfresco.service.namespace.QName> updateQName(org.alfresco.service.namespace.QName qnameOld, org.alfresco.service.namespace.QName qnameNew)
QNameDAO
updateQName
in interface QNameDAO
qnameOld
- the old QName, which must existqnameNew
- the new QName, which must not existpublic void deleteQName(org.alfresco.service.namespace.QName qname)
QNameDAO
deleteQName
in interface QNameDAO
protected abstract QNameEntity findQNameEntityById(Long id)
protected abstract QNameEntity findQNameEntityByNamespaceAndLocalName(Long nsId, String localName)
protected abstract QNameEntity createQNameEntity(Long nsId, String localName)
protected abstract int updateQNameEntity(QNameEntity entity, Long nsId, String localName)
protected abstract int deleteQNameEntity(QNameEntity entity)
public Set<org.alfresco.service.namespace.QName> convertIdsToQNames(Set<Long> ids)
QNameDAO
convertIdsToQNames
in interface QNameDAO
ids
- the IDspublic Map<org.alfresco.service.namespace.QName,? extends Object> convertIdMapToQNameMap(Map<Long,? extends Object> idMap)
QNameDAO
convertIdMapToQNameMap
in interface QNameDAO
idMap
- a map of objects keyed by QName IDpublic Set<Long> convertQNamesToIds(Set<org.alfresco.service.namespace.QName> qnames, boolean create)
QNameDAO
convertQNamesToIds
in interface QNameDAO
qnames
- the QNames to convertcreate
- true to create any missing QName entitiesCopyright © 2005–2017 Alfresco Software. All rights reserved.