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
Direct Known Subclasses:
PatchDAOImpl.Oracle, PatchDAOImpl.PostgreSQL

public class PatchDAOImpl
extends AbstractPatchDAOImpl

iBatis-specific implementation of the AVMPatch DAO.

Since:
3.2

Nested Class Summary
static class PatchDAOImpl.Oracle
          Oracle-specific DAO
static class PatchDAOImpl.PostgreSQL
          PostgreSQL-specific DAO
 
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.patch.PatchDAO
PatchDAO.StringHandler
 
Field Summary
protected  org.mybatis.spring.SqlSessionTemplate template
           
 
Constructor Summary
PatchDAOImpl()
           
 
Method Summary
 int addSizeCurrentProp()
          Add a cm:sizeCurrent property to person nodes that don't have it.
protected  int deleteAclEntities(java.util.List aclIds)
           
protected  int deleteAclMemberEntitiesForAcls(java.util.List aclIds)
           
protected  int deleteDanglingAceEntities()
           
 void executeBatch()
           
 java.util.List getAclsThatInheritFromNonPrimaryParent()
          Get acls that do not inherit from the primary parent.
 java.util.List getAclsThatInheritWithInheritanceUnset()
          Get acls that inherit with inheritance unset
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:
 long getCountNodesWithAspects(java.util.Set qnames)
           
 java.util.List getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
          Get defining acls with inheritance issues
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(org.apache.ibatis.session.ResultHandler resultHandler)
           
protected  void getOldAttrChainingURSImpl(org.apache.ibatis.session.ResultHandler resultHandler)
           
protected  java.util.List getOldAttrCustomNamesImpl()
           
protected  void getOldAttrPropertyBackedBeansImpl(org.apache.ibatis.session.ResultHandler resultHandler)
           
protected  void getOldAttrTenantsImpl(org.apache.ibatis.session.ResultHandler resultHandler)
           
 java.util.List getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl()
          Get shared acls that do not inherit correctly from the defining acl
 java.util.List getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
          Get shared acls with inheritance issues
 void migrateOldAttrDropTables()
          Drop old attribute alf_*attribute* tables
protected  java.util.List selectAllAclEntityIds()
           
protected  java.util.List selectNonDanglingAclEntityIds()
           
 void setLocaleDAO(LocaleDAO localeDAO)
           
 void setQnameDAO(QNameDAO qnameDAO)
           
 void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
           
 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, deleteDanglingAces, getAVMNodesCountWhereNewInStore, getDmNodeCount, getDmNodeCountWithNewACLs, getEmptyGUIDS, getMaxAclId, getNullVersionLayeredDirectories, getNullVersionLayeredFiles, getOldAttrCustomNames, 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
 

Field Detail

template

protected org.mybatis.spring.SqlSessionTemplate template
Constructor Detail

PatchDAOImpl

public PatchDAOImpl()
Method Detail

setSqlSessionTemplate

public final void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)

setQnameDAO

public void setQnameDAO(QNameDAO qnameDAO)

setLocaleDAO

public void setLocaleDAO(LocaleDAO localeDAO)

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

addSizeCurrentProp

public int addSizeCurrentProp()
Description copied from interface: PatchDAO
Add a cm:sizeCurrent property to person nodes that don't have it.


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(org.apache.ibatis.session.ResultHandler resultHandler)
Specified by:
getOldAttrTenantsImpl in class AbstractPatchDAOImpl

getOldAttrAVMLocksImpl

protected void getOldAttrAVMLocksImpl(org.apache.ibatis.session.ResultHandler resultHandler)
Specified by:
getOldAttrAVMLocksImpl in class AbstractPatchDAOImpl

getOldAttrPropertyBackedBeansImpl

protected void getOldAttrPropertyBackedBeansImpl(org.apache.ibatis.session.ResultHandler resultHandler)
Specified by:
getOldAttrPropertyBackedBeansImpl in class AbstractPatchDAOImpl

getOldAttrChainingURSImpl

protected void getOldAttrChainingURSImpl(org.apache.ibatis.session.ResultHandler resultHandler)
Specified by:
getOldAttrChainingURSImpl in class AbstractPatchDAOImpl

getOldAttrCustomNamesImpl

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

migrateOldAttrDropTables

public void migrateOldAttrDropTables()
Description copied from interface: PatchDAO
Drop old attribute alf_*attribute* tables


getAclsThatInheritFromNonPrimaryParent

public java.util.List getAclsThatInheritFromNonPrimaryParent()
Description copied from interface: PatchDAO
Get acls that do not inherit from the primary parent.


getAclsThatInheritWithInheritanceUnset

public java.util.List getAclsThatInheritWithInheritanceUnset()
Description copied from interface: PatchDAO
Get acls that inherit with inheritance unset


getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent

public java.util.List getDefiningAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
Description copied from interface: PatchDAO
Get defining acls with inheritance issues


getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent

public java.util.List getSharedAclsThatDoNotInheritCorrectlyFromThePrimaryParent()
Description copied from interface: PatchDAO
Get shared acls with inheritance issues


getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl

public java.util.List getSharedAclsThatDoNotInheritCorrectlyFromTheirDefiningAcl()
Description copied from interface: PatchDAO
Get shared acls that do not inherit correctly from the defining acl


getCountNodesWithAspects

public long getCountNodesWithAspects(java.util.Set qnames)
Parameters:
qnames - the qnames to search for
Returns:
Returns a count of the number of nodes that have either of the aspects


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