org.alfresco.repo.domain.patch.ibatis
Class PatchDAOImpl

java.lang.Object
  extended by org.alfresco.repo.domain.patch.AbstractPatchDAOImpl
      extended by org.alfresco.repo.domain.patch.ibatis.PatchDAOImpl
All Implemented Interfaces:
org.alfresco.ibatis.BatchingDAO, PatchDAO

public class PatchDAOImpl
extends AbstractPatchDAOImpl

iBatis-specific implementation of the AVMPatch DAO.

Since:
3.2

Nested Class Summary
 
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.patch.PatchDAO
PatchDAO.StringHandler
 
Constructor Summary
PatchDAOImpl()
           
 
Method Summary
protected  int deleteAclEntities(java.util.List aclIds)
           
protected  int deleteAclMemberEntitiesForAcls(java.util.List aclIds)
           
protected  void deleteAllOldAttrsImpl()
           
protected  int deleteDanglingAceEntities()
           
 void executeBatch()
           
protected  java.util.List getAdmOldContentProperties(java.lang.Long minNodeId, java.lang.Long maxNodeId)
          Results are of the form:
 java.util.List getAuthoritiesWithNonUtf8Crcs()
           
protected  long getAVMNodeEntitiesCountWhereNewInStore()
           
protected  java.util.List getAVMNodeEntitiesWithEmptyGUID(int maxResults)
           
 java.util.List getAvmNodesWithOldContentProperties(java.lang.Long minNodeId, java.lang.Long maxNodeId)
           
 int getChildAssocCount()
           
 java.util.List getChildAssocsForCrcFix(java.lang.Long minAssocId, java.lang.Long stopAtAssocId, long rangeMultiplier, long maxIdRange, int maxResults)
          The results map contains:
protected  long getDmNodeEntitiesCount()
           
protected  long getDmNodeEntitiesCountWithNewACLs(java.lang.Long above)
           
protected  long getMaxAclEntityId()
           
 long getMaxAdmNodeID()
           
 long getMaxAvmNodeID()
           
 java.lang.Long getMaxChildAssocId()
           
 java.util.List getNodesOfTypeWithNamePattern(org.alfresco.service.namespace.QName typeQName, java.lang.String namePattern)
          Query for a list of nodes that have a given type and share the same name pattern (SQL LIKE syntax)
protected  java.util.List getNullVersionLayeredDirectoryNodeEntities(int maxResults)
           
protected  java.util.List getNullVersionLayeredFileNodeEntities(int maxResults)
           
protected  void getOldAttrAVMLocksImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
           
protected  void getOldAttrChainingURSImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
           
protected  java.util.List getOldAttrCustomNamesImpl()
           
protected  void getOldAttrPropertyBackedBeansImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
           
protected  void getOldAttrTenantsImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
           
protected  java.util.List selectAllAclEntityIds()
           
protected  java.util.List selectNonDanglingAclEntityIds()
           
protected  void selectUsersWithoutUsageProp(org.alfresco.service.cmr.repository.StoreRef storeRef, PatchDAO.StringHandler handler)
           
 void setQnameDAO(QNameDAO qnameDAO)
           
 void setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate sqlMapClientTemplate)
           
 void startBatch()
           
protected  void updateAdmOldContentProperty(java.lang.Long nodeId, java.lang.Long qnameId, java.lang.Integer listIndex, java.lang.Long localeId, java.lang.Long longValue)
           
protected  int updateAVMNodeEntitiesNullifyAcl(java.util.List nodeIds)
           
protected  int updateAVMNodeEntitiesSetAcl(long aclId, java.util.List nodeIds)
           
 int updateChildAssocCrc(java.lang.Long assocId, java.lang.Long childNodeNameCrc, java.lang.Long qnameCrc)
           
 int updateContentMimetypeIds(java.lang.Long oldMimetypeId, java.lang.Long newMimetypeId)
          Update all alf_content_data mimetype references.
 
Methods inherited from class org.alfresco.repo.domain.patch.AbstractPatchDAOImpl
deleteAclMembersForAcls, deleteAcls, deleteAllOldAttrs, deleteDanglingAces, getAVMNodesCountWhereNewInStore, getDmNodeCount, getDmNodeCountWithNewACLs, getEmptyGUIDS, getMaxAclId, getNullVersionLayeredDirectories, getNullVersionLayeredFiles, getOldAttrCustomNames, getUsersWithoutUsageProp, migrateOldAttrAVMLocks, migrateOldAttrChainingURS, migrateOldAttrPropertyBackedBeans, migrateOldAttrTenants, selectAllAclIds, selectNonDanglingAclIds, setContentDataDAO, updateAdmV31ContentProperties, updateAVMNodesNullifyAcl, updateAVMNodesSetAcl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatchDAOImpl

public PatchDAOImpl()
Method Detail

setSqlMapClientTemplate

public void setSqlMapClientTemplate(org.springframework.orm.ibatis.SqlMapClientTemplate sqlMapClientTemplate)

setQnameDAO

public void setQnameDAO(QNameDAO qnameDAO)

startBatch

public void startBatch()

executeBatch

public void executeBatch()

getAVMNodeEntitiesCountWhereNewInStore

protected long getAVMNodeEntitiesCountWhereNewInStore()
Specified by:
getAVMNodeEntitiesCountWhereNewInStore in class AbstractPatchDAOImpl

getAVMNodeEntitiesWithEmptyGUID

protected java.util.List getAVMNodeEntitiesWithEmptyGUID(int maxResults)
Specified by:
getAVMNodeEntitiesWithEmptyGUID in class AbstractPatchDAOImpl

getNullVersionLayeredDirectoryNodeEntities

protected java.util.List getNullVersionLayeredDirectoryNodeEntities(int maxResults)
Specified by:
getNullVersionLayeredDirectoryNodeEntities in class AbstractPatchDAOImpl

getNullVersionLayeredFileNodeEntities

protected java.util.List getNullVersionLayeredFileNodeEntities(int maxResults)
Specified by:
getNullVersionLayeredFileNodeEntities in class AbstractPatchDAOImpl

getMaxAvmNodeID

public long getMaxAvmNodeID()

getAvmNodesWithOldContentProperties

public java.util.List getAvmNodesWithOldContentProperties(java.lang.Long minNodeId,
                                                          java.lang.Long maxNodeId)

getMaxAdmNodeID

public long getMaxAdmNodeID()

getAdmOldContentProperties

protected java.util.List getAdmOldContentProperties(java.lang.Long minNodeId,
                                                    java.lang.Long maxNodeId)
Description copied from class: AbstractPatchDAOImpl
Results are of the form:
      nodeId: java.lang.Long
      qnameId: java.lang.Long
      listIndex: java.lang.Integer
      localeId: java.lang.Long
      stringValue: java.lang.String
 

Specified by:
getAdmOldContentProperties in class AbstractPatchDAOImpl
Parameters:
minNodeId - inclusive lower bound for Node ID
maxNodeId - exclusive upper bound for Node ID
Returns:
Returns a map of query results

updateAdmOldContentProperty

protected void updateAdmOldContentProperty(java.lang.Long nodeId,
                                           java.lang.Long qnameId,
                                           java.lang.Integer listIndex,
                                           java.lang.Long localeId,
                                           java.lang.Long longValue)
Specified by:
updateAdmOldContentProperty in class AbstractPatchDAOImpl
Parameters:
nodeId - part of the unique key
qnameId - part of the unique key
listIndex - part of the unique key
localeId - part of the unique key
longValue - the new ContentData ID

updateContentMimetypeIds

public int updateContentMimetypeIds(java.lang.Long oldMimetypeId,
                                    java.lang.Long newMimetypeId)
Description copied from interface: PatchDAO
Update all alf_content_data mimetype references.

Parameters:
oldMimetypeId - the ID to search for
newMimetypeId - the ID to change to
Returns:
the number of rows affected

selectUsersWithoutUsageProp

protected void selectUsersWithoutUsageProp(org.alfresco.service.cmr.repository.StoreRef storeRef,
                                           PatchDAO.StringHandler handler)
Specified by:
selectUsersWithoutUsageProp in class AbstractPatchDAOImpl

updateAVMNodeEntitiesNullifyAcl

protected int updateAVMNodeEntitiesNullifyAcl(java.util.List nodeIds)
Specified by:
updateAVMNodeEntitiesNullifyAcl in class AbstractPatchDAOImpl

updateAVMNodeEntitiesSetAcl

protected int updateAVMNodeEntitiesSetAcl(long aclId,
                                          java.util.List nodeIds)
Specified by:
updateAVMNodeEntitiesSetAcl in class AbstractPatchDAOImpl

getMaxAclEntityId

protected long getMaxAclEntityId()
Specified by:
getMaxAclEntityId in class AbstractPatchDAOImpl

getDmNodeEntitiesCount

protected long getDmNodeEntitiesCount()
Specified by:
getDmNodeEntitiesCount in class AbstractPatchDAOImpl

getDmNodeEntitiesCountWithNewACLs

protected long getDmNodeEntitiesCountWithNewACLs(java.lang.Long above)
Specified by:
getDmNodeEntitiesCountWithNewACLs in class AbstractPatchDAOImpl

selectAllAclEntityIds

protected java.util.List selectAllAclEntityIds()
Specified by:
selectAllAclEntityIds in class AbstractPatchDAOImpl

selectNonDanglingAclEntityIds

protected java.util.List selectNonDanglingAclEntityIds()
Specified by:
selectNonDanglingAclEntityIds in class AbstractPatchDAOImpl

deleteDanglingAceEntities

protected int deleteDanglingAceEntities()
Specified by:
deleteDanglingAceEntities in class AbstractPatchDAOImpl

deleteAclEntities

protected int deleteAclEntities(java.util.List aclIds)
Specified by:
deleteAclEntities in class AbstractPatchDAOImpl

deleteAclMemberEntitiesForAcls

protected int deleteAclMemberEntitiesForAcls(java.util.List aclIds)
Specified by:
deleteAclMemberEntitiesForAcls in class AbstractPatchDAOImpl

getAuthoritiesWithNonUtf8Crcs

public java.util.List getAuthoritiesWithNonUtf8Crcs()
Returns:
Returns the names of authorities with incorrect CRC values

getChildAssocCount

public int getChildAssocCount()
Returns:
Returns the number child association rows

getMaxChildAssocId

public java.lang.Long getMaxChildAssocId()
Returns:
Returns the maximum child assoc ID or 0 if there are none

getChildAssocsForCrcFix

public java.util.List getChildAssocsForCrcFix(java.lang.Long minAssocId,
                                              java.lang.Long stopAtAssocId,
                                              long rangeMultiplier,
                                              long maxIdRange,
                                              int maxResults)
Description copied from interface: PatchDAO
The results map contains:
 
        
        
        
        
        
        
        
       ]]>
 

Parameters:
minAssocId - the minimum child assoc ID
stopAtAssocId - the child assoc ID to stop at i.e. once this ID has been reached, pull back no results
rangeMultiplier - the ration of IDs to actual rows (how many IDs to select to get a row)
maxIdRange - the largest ID range to use for selects. Normally, the ID range should be allowed to grow in accordance with the general distribution of rows, but if memory problems are encountered, then the range will need to be set down.
maxResults - the number of child associations to fetch
Returns:
Returns child associations that need fixing

updateChildAssocCrc

public int updateChildAssocCrc(java.lang.Long assocId,
                               java.lang.Long childNodeNameCrc,
                               java.lang.Long qnameCrc)

getNodesOfTypeWithNamePattern

public java.util.List getNodesOfTypeWithNamePattern(org.alfresco.service.namespace.QName typeQName,
                                                    java.lang.String namePattern)
Description copied from interface: PatchDAO
Query for a list of nodes that have a given type and share the same name pattern (SQL LIKE syntax)

Parameters:
typeQName - the node type
namePattern - the SQL LIKE pattern
Returns:
Returns the node ID and node name

getOldAttrTenantsImpl

protected void getOldAttrTenantsImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
Specified by:
getOldAttrTenantsImpl in class AbstractPatchDAOImpl

getOldAttrAVMLocksImpl

protected void getOldAttrAVMLocksImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
Specified by:
getOldAttrAVMLocksImpl in class AbstractPatchDAOImpl

getOldAttrPropertyBackedBeansImpl

protected void getOldAttrPropertyBackedBeansImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
Specified by:
getOldAttrPropertyBackedBeansImpl in class AbstractPatchDAOImpl

getOldAttrChainingURSImpl

protected void getOldAttrChainingURSImpl(com.ibatis.sqlmap.client.event.RowHandler rowHandler)
Specified by:
getOldAttrChainingURSImpl in class AbstractPatchDAOImpl

getOldAttrCustomNamesImpl

protected java.util.List getOldAttrCustomNamesImpl()
Specified by:
getOldAttrCustomNamesImpl in class AbstractPatchDAOImpl

deleteAllOldAttrsImpl

protected void deleteAllOldAttrsImpl()
Specified by:
deleteAllOldAttrsImpl in class AbstractPatchDAOImpl


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