com.imcode.imcms.dao
Class ContentLoopDao

java.lang.Object
  extended by org.springframework.orm.hibernate3.HibernateAccessor
      extended by org.springframework.orm.hibernate3.HibernateTemplate
          extended by com.imcode.imcms.dao.ContentLoopDao
All Implemented Interfaces:
org.springframework.beans.factory.BeanFactoryAware, org.springframework.beans.factory.InitializingBean, org.springframework.orm.hibernate3.HibernateOperations

public class ContentLoopDao
extends org.springframework.orm.hibernate3.HibernateTemplate

Content loop DAO.

Author:
Anton Josua

Field Summary
 
Fields inherited from class org.springframework.orm.hibernate3.HibernateAccessor
FLUSH_ALWAYS, FLUSH_AUTO, FLUSH_COMMIT, FLUSH_EAGER, FLUSH_NEVER, logger
 
Constructor Summary
ContentLoopDao()
           
 
Method Summary
 Content addFisrtContent(java.lang.Long loopId)
          Creates and adds new Content at the fist position of the loop.
 Content addLastContent(java.lang.Long loopId)
          Creates and adds new Content at the last position of the loop.
 ContentLoop createContentLoop(java.lang.Integer documentId, java.lang.Integer loopIndex, java.lang.Integer baseIndex)
           
 void deleteContent(java.lang.Long id)
           
 ContentLoop getContentLoop(java.lang.Integer documentId, java.lang.Integer index)
          Returns loop or null if loop can not be found.
 java.util.List<ContentLoop> getContentLoops(java.lang.Integer documentId)
          Returns document content loops.
 Content insertNewContentAfter(ContentLoop loop, java.lang.Long contentId)
           
 Content insertNewContentBefore(ContentLoop loop, java.lang.Long contentId)
           
 void moveContentDown(ContentLoop loop, java.lang.Long contentId)
           
 void moveContentUp(ContentLoop loop, java.lang.Long contentId)
           
 void saveContentLoop(java.lang.Integer documentId, ContentLoop contentLoop)
           
 
Methods inherited from class org.springframework.orm.hibernate3.HibernateTemplate
applyNamedParameterToQuery, bulkUpdate, bulkUpdate, bulkUpdate, checkWriteOperationAllowed, clear, closeIterator, contains, createSessionProxy, delete, delete, delete, delete, deleteAll, doExecute, enableFilter, evict, execute, execute, executeFind, executeWithNativeSession, executeWithNewSession, find, find, find, findByCriteria, findByCriteria, findByExample, findByExample, findByExample, findByExample, findByNamedParam, findByNamedParam, findByNamedQuery, findByNamedQuery, findByNamedQuery, findByNamedQueryAndNamedParam, findByNamedQueryAndNamedParam, findByNamedQueryAndValueBean, findByValueBean, flush, get, get, get, get, getFetchSize, getMaxResults, getQueryCacheRegion, getSession, initialize, isAllowCreate, isAlwaysUseNewSession, isCacheQueries, isCheckWriteOperations, isExposeNativeSession, iterate, iterate, iterate, load, load, load, load, load, loadAll, lock, lock, merge, merge, persist, persist, prepareCriteria, prepareQuery, refresh, refresh, replicate, replicate, save, save, saveOrUpdate, saveOrUpdate, saveOrUpdateAll, setAllowCreate, setAlwaysUseNewSession, setCacheQueries, setCheckWriteOperations, setExposeNativeSession, setFetchSize, setMaxResults, setQueryCacheRegion, update, update, update, update
 
Methods inherited from class org.springframework.orm.hibernate3.HibernateAccessor
afterPropertiesSet, applyFlushMode, convertHibernateAccessException, convertJdbcAccessException, convertJdbcAccessException, disableFilters, enableFilters, flushIfNecessary, getDefaultJdbcExceptionTranslator, getEntityInterceptor, getFilterNames, getFlushMode, getJdbcExceptionTranslator, getSessionFactory, setBeanFactory, setEntityInterceptor, setEntityInterceptorBeanName, setFilterName, setFilterNames, setFlushMode, setFlushModeName, setJdbcExceptionTranslator, setSessionFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ContentLoopDao

public ContentLoopDao()
Method Detail

addFisrtContent

@Transactional
public Content addFisrtContent(java.lang.Long loopId)
Creates and adds new Content at the fist position of the loop.

Parameters:
loopId - loop id
Returns:
new Content added at the fist position of the loop.

addLastContent

@Transactional
public Content addLastContent(java.lang.Long loopId)
Creates and adds new Content at the last position of the loop.

Parameters:
loopId - loop id
Returns:
new Content added at the last position of the loop.

saveContentLoop

@Transactional
public void saveContentLoop(java.lang.Integer documentId,
                                          ContentLoop contentLoop)

createContentLoop

@Transactional
public ContentLoop createContentLoop(java.lang.Integer documentId,
                                                   java.lang.Integer loopIndex,
                                                   java.lang.Integer baseIndex)

deleteContent

@Transactional
public void deleteContent(java.lang.Long id)

getContentLoop

@Transactional
public ContentLoop getContentLoop(java.lang.Integer documentId,
                                                java.lang.Integer index)
Returns loop or null if loop can not be found.

Parameters:
metaId - meta id.
index - loop index.
Returns:
loop or null if loop can not be found.

getContentLoops

@Transactional
public java.util.List<ContentLoop> getContentLoops(java.lang.Integer documentId)
Returns document content loops.

Parameters:
metaId - document's id.
Returns:
document content loops.

moveContentUp

@Transactional
public void moveContentUp(ContentLoop loop,
                                        java.lang.Long contentId)

moveContentDown

@Transactional
public void moveContentDown(ContentLoop loop,
                                          java.lang.Long contentId)

insertNewContentAfter

@Transactional
public Content insertNewContentAfter(ContentLoop loop,
                                                   java.lang.Long contentId)

insertNewContentBefore

@Transactional
public Content insertNewContentBefore(ContentLoop loop,
                                                    java.lang.Long contentId)