Class HibernateStampDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Stamp>
com.logicaldoc.stamp.HibernateStampDAO
All Implemented Interfaces:
com.logicaldoc.core.PersistentObjectDAO<Stamp>, StampDAO

public class HibernateStampDAO extends com.logicaldoc.core.HibernatePersistentObjectDAO<Stamp> implements StampDAO
Hibernate implementation of StampDAO
Since:
7.3
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 stampId, int code)
     
    findByName(String name, long tenantId)
    Finds the stamp with the given name
    findByNameAndUser(String name, long userId)
    Finds the stamp with the given name and user
    findByUser(long userId, boolean enabledOnly)
    Finds the stamps for the given user
    void
     
    boolean
    isReadEnable(long id, long userId)
    This method is looking up for read permission for a stamp and an user
    boolean
    isWriteEnable(long id, long userId)
    This method is looking up for write permission for a stamp and an user

    Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

    bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, 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, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, store
  • Method Details

    • delete

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

      public Stamp findByName(String name, long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: StampDAO
      Finds the stamp with the given name
      Specified by:
      findByName in interface StampDAO
      Parameters:
      name - name of the stamp
      tenantId - identifier of the tenant
      Returns:
      the found stamp
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • findByUser

      public List<Stamp> findByUser(long userId, boolean enabledOnly) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: StampDAO
      Finds the stamps for the given user
      Specified by:
      findByUser in interface StampDAO
      Parameters:
      userId - identifier of the user
      enabledOnly - if just the enabled stamps must be searched
      Returns:
      list of stamps
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • initialize

      public void initialize(Stamp stamp)
      Specified by:
      initialize in interface com.logicaldoc.core.PersistentObjectDAO<Stamp>
      Overrides:
      initialize in class com.logicaldoc.core.HibernatePersistentObjectDAO<Stamp>
    • findByNameAndUser

      public Stamp findByNameAndUser(String name, long userId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: StampDAO
      Finds the stamp with the given name and user
      Specified by:
      findByNameAndUser in interface StampDAO
      Parameters:
      name - name of the stamp
      userId - identifier of the user
      Returns:
      the found stamp
      Throws:
      com.logicaldoc.core.PersistenceException - error at data layer
    • isWriteEnable

      public boolean isWriteEnable(long id, long userId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: StampDAO
      This method is looking up for write permission for a stamp and an user
      Specified by:
      isWriteEnable in interface StampDAO
      Parameters:
      id - ID of the stamp
      userId - ID of the user
      Returns:
      id the user has write permission
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • isReadEnable

      public boolean isReadEnable(long id, long userId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: StampDAO
      This method is looking up for read permission for a stamp and an user
      Specified by:
      isReadEnable in interface StampDAO
      Parameters:
      id - ID of the stamp
      userId - ID of the user
      Returns:
      if the user can access the stamp
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database