org.alfresco.repo.domain.contentdata.ibatis
Class ContentDataDAOImpl

java.lang.Object
  extended by org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
      extended by org.alfresco.repo.domain.contentdata.ibatis.ContentDataDAOImpl
All Implemented Interfaces:
ContentDataDAO

public class ContentDataDAOImpl
extends AbstractContentDataDAOImpl

iBatis-specific implementation of the ContentData DAO.

Since:
3.2

Nested Class Summary
 
Nested classes/interfaces inherited from class org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
AbstractContentDataDAOImpl.ContentUrlDeleteTransactionListener
 
Nested classes/interfaces inherited from interface org.alfresco.repo.domain.contentdata.ContentDataDAO
ContentDataDAO.ContentUrlHandler
 
Constructor Summary
ContentDataDAOImpl()
           
 
Method Summary
protected  ContentDataEntity createContentDataEntity(java.lang.Long contentUrlId, java.lang.Long mimetypeId, java.lang.Long encodingId, java.lang.Long localeId)
          Create the row for the alf_content_data
protected  ContentUrlEntity createContentUrlEntity(java.lang.String contentUrl, long size)
           
 org.alfresco.util.Pair createContentUrlOrphaned(java.lang.String contentUrl, java.util.Date orphanTime)
          Creates an immediately-orphaned content URL, if possible
protected  int deleteContentDataEntity(java.lang.Long id)
          Delete the entity with the given ID
 void deleteContentDataForNode(java.lang.Long nodeId, java.util.Set qnameIds)
          Deletes all alf_content_data rows that are referenced by the given node
 int deleteContentUrls(java.util.List ids)
          Delete a batch of content URL entities.
protected  ContentDataEntity getContentDataEntity(java.lang.Long id)
           
protected  ContentUrlEntity getContentUrlEntity(java.lang.Long id)
           
protected  ContentUrlEntity getContentUrlEntity(java.lang.String contentUrl)
           
protected  ContentUrlEntity getContentUrlEntityUnreferenced(java.lang.String contentUrl)
           
 void getContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler, java.lang.Long maxOrphanTimeExclusive, int maxResults)
          Enumerate all available content URLs that were orphaned on or before the given time
 void setSqlSessionTemplate(org.mybatis.spring.SqlSessionTemplate sqlSessionTemplate)
           
protected  int updateContentDataEntity(ContentDataEntity entity)
          Update an existing alf_content_data entity
 int updateContentUrlOrphanTime(java.lang.Long id, java.lang.Long orphanTime, java.lang.Long oldOrphanTime)
          Update a content URL with the given orphan time
 
Methods inherited from class org.alfresco.repo.domain.contentdata.AbstractContentDataDAOImpl
createContentData, deleteContentData, getContentData, registerDereferencedContentUrl, setContentDataCache, setContentStoreCleaner, setControlDAO, setEncodingDAO, setLocaleDAO, setMimetypeDAO, updateContentData
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentDataDAOImpl

public ContentDataDAOImpl()
Method Detail

setSqlSessionTemplate

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

createContentUrlOrphaned

public org.alfresco.util.Pair createContentUrlOrphaned(java.lang.String contentUrl,
                                                       java.util.Date orphanTime)
Description copied from interface: ContentDataDAO
Creates an immediately-orphaned content URL, if possible

Parameters:
contentUrl - the URL to create if it doesn't exist
Returns:
Returns the ID-URL pair

createContentUrlEntity

protected ContentUrlEntity createContentUrlEntity(java.lang.String contentUrl,
                                                  long size)
Specified by:
createContentUrlEntity in class AbstractContentDataDAOImpl
Parameters:
contentUrl - the content URL to create or search for

getContentUrlEntity

protected ContentUrlEntity getContentUrlEntity(java.lang.Long id)
Specified by:
getContentUrlEntity in class AbstractContentDataDAOImpl
Parameters:
id - the ID of the content url entity
Returns:
Return the entity or null if it doesn't exist

getContentUrlEntity

protected ContentUrlEntity getContentUrlEntity(java.lang.String contentUrl)
Specified by:
getContentUrlEntity in class AbstractContentDataDAOImpl
Parameters:
contentUrl - the URL of the content url entity
Returns:
Return the entity or null if it doesn't exist

getContentUrlsOrphaned

public void getContentUrlsOrphaned(ContentDataDAO.ContentUrlHandler contentUrlHandler,
                                   java.lang.Long maxOrphanTimeExclusive,
                                   int maxResults)
Description copied from interface: ContentDataDAO
Enumerate all available content URLs that were orphaned on or before the given time

Parameters:
contentUrlHandler - the callback object to process the rows
maxOrphanTimeExclusive - the maximum orphan time (exclusive)
maxResults - the maximum number of results (1 or greater)

updateContentUrlOrphanTime

public int updateContentUrlOrphanTime(java.lang.Long id,
                                      java.lang.Long orphanTime,
                                      java.lang.Long oldOrphanTime)
Description copied from class: AbstractContentDataDAOImpl
Update a content URL with the given orphan time

Specified by:
updateContentUrlOrphanTime in class AbstractContentDataDAOImpl
Parameters:
id - the unique ID of the entity
orphanTime - the time (ms since epoch) that the entity was orphaned
oldOrphanTime - the orphan time we expect to update for optimistic locking (may be null)
Returns:
Returns the number of rows updated

deleteContentUrls

public int deleteContentUrls(java.util.List ids)
Delete a batch of content URL entities.


getContentUrlEntityUnreferenced

protected ContentUrlEntity getContentUrlEntityUnreferenced(java.lang.String contentUrl)
Specified by:
getContentUrlEntityUnreferenced in class AbstractContentDataDAOImpl
Parameters:
contentUrl - the URL of the content url entity
Returns:
Return the entity or null if it doesn't exist or is still referenced by a content_data entity

createContentDataEntity

protected ContentDataEntity createContentDataEntity(java.lang.Long contentUrlId,
                                                    java.lang.Long mimetypeId,
                                                    java.lang.Long encodingId,
                                                    java.lang.Long localeId)
Description copied from class: AbstractContentDataDAOImpl
Create the row for the alf_content_data

Specified by:
createContentDataEntity in class AbstractContentDataDAOImpl

getContentDataEntity

protected ContentDataEntity getContentDataEntity(java.lang.Long id)
Specified by:
getContentDataEntity in class AbstractContentDataDAOImpl
Parameters:
id - the entity ID
Returns:
Returns the entity or null if it doesn't exist

updateContentDataEntity

protected int updateContentDataEntity(ContentDataEntity entity)
Description copied from class: AbstractContentDataDAOImpl
Update an existing alf_content_data entity

Specified by:
updateContentDataEntity in class AbstractContentDataDAOImpl
Parameters:
entity - the existing entity that will be updated
Returns:
Returns the number of rows updated (should be 1)

deleteContentDataEntity

protected int deleteContentDataEntity(java.lang.Long id)
Description copied from class: AbstractContentDataDAOImpl
Delete the entity with the given ID

Specified by:
deleteContentDataEntity in class AbstractContentDataDAOImpl
Returns:
Returns the number of rows deleted

deleteContentDataForNode

public void deleteContentDataForNode(java.lang.Long nodeId,
                                     java.util.Set qnameIds)
Description copied from interface: ContentDataDAO
Deletes all alf_content_data rows that are referenced by the given node

Parameters:
nodeId - the node ID
qnameIds - the content properties to target


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