Class PatchDAOImpl
- java.lang.Object
-
- org.alfresco.repo.domain.patch.AbstractPatchDAOImpl
-
- org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl
-
- All Implemented Interfaces:
BatchingDAO,PatchDAO
- Direct Known Subclasses:
PatchDAOImpl.Oracle,PatchDAOImpl.PostgreSQL
public class PatchDAOImpl extends AbstractPatchDAOImpl
iBatis-specific implementation of the PatchDAO.- Since:
- 3.2
- Author:
- janv
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classPatchDAOImpl.OracleOracle-specific DAOstatic classPatchDAOImpl.PostgreSQLPostgreSQL-specific DAO
-
Field Summary
Fields Modifier and Type Field Description protected org.mybatis.spring.SqlSessionTemplatetemplate
-
Constructor Summary
Constructors Constructor Description PatchDAOImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidexecuteBatch()Write a batch of insert or update commandsList<org.alfresco.service.cmr.repository.NodeRef>getChildrenOfTheSharedSurfConfigFolder(Long minNodeId, Long maxNodeId)Finds folders of the shared surf-config (for all tenants): company_home/sites/surf-config/components company_home/sites/surf-config/pages company_home/sites/surf-config/pages/user company_home/sites/surf-config/pages/user{userId}longgetCountNodesWithAspects(Set<org.alfresco.service.namespace.QName> qnames)longgetCountNodesWithTypId(org.alfresco.service.namespace.QName typeQName)Gets the total number of nodes which match the given Type QName.longgetMaxAdmNodeID()List<Long>getNodesByAspectQNameId(Long aspectQNameId, Long minNodeId, Long maxNodeId)Find all the nodes ids with the given aspectList<Long>getNodesByContentPropertyMimetypeId(Long mimetypeId, Long minNodeId, Long maxNodeId)Find all the nodes ids with the given content property set with the given mimetypeList<Long>getNodesByTypeQNameAndAspectQNameId(long typeQNameId, long aspectQNameId, long minNodeId, long maxNodeId)Find all the nodes ids with the given aspect and typeList<Long>getNodesByTypeQNameId(Long typeQNameId, Long minNodeId, Long maxNodeId)Find all the nodes ids with the given typeList<Long>getNodesByTypeUriId(Long nsId, Long minNodeId, Long maxNodeId)Find all the nodes ids with the given type uriList<org.alfresco.util.Pair<org.alfresco.service.cmr.repository.NodeRef,String>>getNodesOfTypeWithNamePattern(org.alfresco.service.namespace.QName typeQName, String namePattern)Query for a list of nodes that have a given type and share the same name pattern (SQL LIKE syntax)voidsetContentDataDAO(ContentDataDAO contentDataDAO)voidsetLocaleDAO(LocaleDAO localeDAO)voidsetQnameDAO(QNameDAO qnameDAO)voidsetSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)voidstartBatch()Start a batch of insert or update commandsintupdateContentMimetypeIds(Long oldMimetypeId, Long newMimetypeId)Update all alf_content_data mimetype references.intupdatePersonSizeCurrentType()Update all alf_node_properties of 'sizeCurrent' name to have correct persisted type of Long.
-
-
-
Method Detail
-
setSqlSessionTemplate
public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
-
setQnameDAO
public void setQnameDAO(QNameDAO qnameDAO)
-
setLocaleDAO
public void setLocaleDAO(LocaleDAO localeDAO)
-
setContentDataDAO
public void setContentDataDAO(ContentDataDAO contentDataDAO)
-
startBatch
public void startBatch()
Description copied from interface:BatchingDAOStart a batch of insert or update commands
-
executeBatch
public void executeBatch()
Description copied from interface:BatchingDAOWrite a batch of insert or update commands
-
getMaxAdmNodeID
public long getMaxAdmNodeID()
-
updateContentMimetypeIds
public int updateContentMimetypeIds(Long oldMimetypeId, Long newMimetypeId)
Description copied from interface:PatchDAOUpdate all alf_content_data mimetype references.- Parameters:
oldMimetypeId- the ID to search fornewMimetypeId- the ID to change to- Returns:
- the number of rows affected
-
updatePersonSizeCurrentType
public int updatePersonSizeCurrentType()
Description copied from interface:PatchDAOUpdate all alf_node_properties of 'sizeCurrent' name to have correct persisted type of Long.- Returns:
- the number of rows affected
-
getNodesOfTypeWithNamePattern
public List<org.alfresco.util.Pair<org.alfresco.service.cmr.repository.NodeRef,String>> getNodesOfTypeWithNamePattern(org.alfresco.service.namespace.QName typeQName, String namePattern)
Description copied from interface:PatchDAOQuery for a list of nodes that have a given type and share the same name pattern (SQL LIKE syntax)- Parameters:
typeQName- the node typenamePattern- the SQL LIKE pattern- Returns:
- Returns the node ID and node name
-
getCountNodesWithAspects
public long getCountNodesWithAspects(Set<org.alfresco.service.namespace.QName> qnames)
- Parameters:
qnames- the qnames to search for- Returns:
- Returns a count of the number of nodes that have either of the aspects
-
getNodesByTypeQNameId
public List<Long> getNodesByTypeQNameId(Long typeQNameId, Long minNodeId, Long maxNodeId)
Description copied from interface:PatchDAOFind all the nodes ids with the given type- Parameters:
typeQNameId- - the id of the type qnameminNodeId- - min node id in the result set - inclusivemaxNodeId- - max node id in the result set - exclusive- Returns:
- IDs of the nodes
-
getNodesByTypeUriId
public List<Long> getNodesByTypeUriId(Long nsId, Long minNodeId, Long maxNodeId)
Description copied from interface:PatchDAOFind all the nodes ids with the given type uri- Parameters:
nsId- - the id of the type qname uriminNodeId- - min node id in the result set - inclusivemaxNodeId- - max node id in the result set - exclusive- Returns:
- IDs of the nodes
-
getNodesByAspectQNameId
public List<Long> getNodesByAspectQNameId(Long aspectQNameId, Long minNodeId, Long maxNodeId)
Description copied from interface:PatchDAOFind all the nodes ids with the given aspect- Parameters:
aspectQNameId- - the id of the aspect qnameminNodeId- - min node id in the result set - inclusivemaxNodeId- - max node id in the result set - exclusive- Returns:
- IDs of the nodes
-
getNodesByContentPropertyMimetypeId
public List<Long> getNodesByContentPropertyMimetypeId(Long mimetypeId, Long minNodeId, Long maxNodeId)
Description copied from interface:PatchDAOFind all the nodes ids with the given content property set with the given mimetype- Parameters:
mimetypeId- - the id of the content data mimetypeminNodeId- - min node id in the result set - inclusivemaxNodeId- - max node id in the result set - exclusive- Returns:
- IDs of the nodes
-
getNodesByTypeQNameAndAspectQNameId
public List<Long> getNodesByTypeQNameAndAspectQNameId(long typeQNameId, long aspectQNameId, long minNodeId, long maxNodeId)
Description copied from interface:PatchDAOFind all the nodes ids with the given aspect and type- Parameters:
typeQNameId- - the id of the type qnameaspectQNameId- - the id of the aspect qnameminNodeId- - min node id in the result set - inclusivemaxNodeId- - max node id in the result set - exclusive- Returns:
- List
-
getCountNodesWithTypId
public long getCountNodesWithTypId(org.alfresco.service.namespace.QName typeQName)
Description copied from interface:PatchDAOGets the total number of nodes which match the given Type QName.- Parameters:
typeQName- the qname to search for- Returns:
- count of nodes that match the typeQName
-
getChildrenOfTheSharedSurfConfigFolder
public List<org.alfresco.service.cmr.repository.NodeRef> getChildrenOfTheSharedSurfConfigFolder(Long minNodeId, Long maxNodeId)
Description copied from interface:PatchDAOFinds folders of the shared surf-config (for all tenants):- company_home/sites/surf-config/components
- company_home/sites/surf-config/pages
- company_home/sites/surf-config/pages/user
- company_home/sites/surf-config/pages/user{userId}
- Parameters:
minNodeId- - min node id in the result set - inclusivemaxNodeId- - max node id in the result set - exclusive- Returns:
- list of children nodeRefs
-
-