Class HibernateAutomationRoutineDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<AutomationRoutine>
com.logicaldoc.enterprise.automation.HibernateAutomationRoutineDAO
All Implemented Interfaces:
com.logicaldoc.core.PersistentObjectDAO<AutomationRoutine>, AutomationRoutineDAO

public class HibernateAutomationRoutineDAO extends com.logicaldoc.core.HibernatePersistentObjectDAO<AutomationRoutine> implements AutomationRoutineDAO
Implements the DAO for automation routines
Since:
8.1
Author:
Marco Meschieri - LogicalDOC
  • Field Summary

    Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

    ENTITY
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    delete(long id, int code)
     
    findByName(String name, long tenantId)
     
    findByUser(long userId)
    This method loads all the routines accessible by the given user
    Set<com.logicaldoc.core.security.Permission>
    getEnabledPermissions(long routineId, long userId)
    Finds all permissions of a user enabled on the specified routine
    void
     
    boolean
    isReadEnabled(long routineId, long userId)
    This method is looking up for read rights for a routine and an user
    boolean
    isWriteEnabled(long routineId, long userId)
    Returns if a routine is writable for a user
    void
    setUserDao(com.logicaldoc.core.security.user.UserDAO userDao)
     

    Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

    bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, setSessionFactory, store

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

    bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, store
  • Method Details

    • findByName

      public AutomationRoutine findByName(String name, long tenantId)
      Specified by:
      findByName in interface AutomationRoutineDAO
    • initialize

      public void initialize(AutomationRoutine routine)
      Specified by:
      initialize in interface com.logicaldoc.core.PersistentObjectDAO<AutomationRoutine>
      Overrides:
      initialize in class com.logicaldoc.core.HibernatePersistentObjectDAO<AutomationRoutine>
    • delete

      public void delete(long id, int code) throws com.logicaldoc.core.PersistenceException
      Specified by:
      delete in interface com.logicaldoc.core.PersistentObjectDAO<AutomationRoutine>
      Overrides:
      delete in class com.logicaldoc.core.HibernatePersistentObjectDAO<AutomationRoutine>
      Throws:
      com.logicaldoc.core.PersistenceException
    • getEnabledPermissions

      public Set<com.logicaldoc.core.security.Permission> getEnabledPermissions(long routineId, long userId)
      Description copied from interface: AutomationRoutineDAO
      Finds all permissions of a user enabled on the specified routine
      Specified by:
      getEnabledPermissions in interface AutomationRoutineDAO
      Parameters:
      routineId - ID of the routine
      userId - ID of the user
      Returns:
      Collection of enabled permissions
    • isWriteEnabled

      public boolean isWriteEnabled(long routineId, long userId)
      Description copied from interface: AutomationRoutineDAO
      Returns if a routine is writable for a user
      Specified by:
      isWriteEnabled in interface AutomationRoutineDAO
      Parameters:
      routineId - check this routine
      userId - privileges for this should be checked
      Returns:
      if the user can edit the routine
    • isReadEnabled

      public boolean isReadEnabled(long routineId, long userId)
      Description copied from interface: AutomationRoutineDAO
      This method is looking up for read rights for a routine and an user
      Specified by:
      isReadEnabled in interface AutomationRoutineDAO
      Parameters:
      routineId - ID of the routine
      userId - ID of the user
      Returns:
      if the user can access the routine
    • findByUser

      public List<AutomationRoutine> findByUser(long userId)
      Description copied from interface: AutomationRoutineDAO
      This method loads all the routines accessible by the given user
      Specified by:
      findByUser in interface AutomationRoutineDAO
      Parameters:
      userId - optional user specification
      Returns:
      list of automation routines with read permission for the user
    • setUserDao

      public void setUserDao(com.logicaldoc.core.security.user.UserDAO userDao)