Class HibernateReportDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Report>
com.logicaldoc.report.HibernateReportDAO
All Implemented Interfaces:
com.logicaldoc.core.PersistentObjectDAO<Report>, ReportDAO

@Repository("reportDAO") public class HibernateReportDAO extends com.logicaldoc.core.HibernatePersistentObjectDAO<Report> implements ReportDAO
Hibernate implementation of ReportDAO
Since:
7.3.1
Author:
Marco Meschieri - LogicalDOC
  • Field Summary

    Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

    ENTITY
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    cleanZombies(long tenantId)
    Cleans the status of zombie reports
    void
    delete(long reportId, int code)
     
    findByName(String name, long tenantId)
    Finds the report with the given name
    findByUser(long userId)
    Finds the reports accessible by the given user
    findZombies(long tenantId)
    Retrieves all the reports that are running for more than one hour
    Set<com.logicaldoc.core.security.Permission>
    getAllowedPermissions(long reportId, long userId)
    Finds all permissions of a user enabled on the specified report
    void
     
    boolean
    isReadAllowed(long reportId, long userId)
    This method is looking up for read rights for a report and an user
    boolean
    isWriteAllowed(long reportId, long userId)
    This method is looking up for writing rights for a report and an user
    void
    store(Report report, File design)
    Stores the report and it's design file

    Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

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

    • delete

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

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

      public void store(Report report, File design) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: ReportDAO
      Stores the report and it's design file
      Specified by:
      store in interface ReportDAO
      Parameters:
      report - the report to store
      design - the file containing the report's design
      Throws:
      com.logicaldoc.core.PersistenceException - error at data layer
    • findZombies

      public List<Report> findZombies(long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: ReportDAO
      Retrieves all the reports that are running for more than one hour
      Specified by:
      findZombies in interface ReportDAO
      Parameters:
      tenantId - identifier of the tenant
      Returns:
      list of reports
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • cleanZombies

      public void cleanZombies(long tenantId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: ReportDAO
      Cleans the status of zombie reports
      Specified by:
      cleanZombies in interface ReportDAO
      Parameters:
      tenantId - identifier of the tenant
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • initialize

      public void initialize(Report rpt) throws com.logicaldoc.core.PersistenceException
      Specified by:
      initialize in interface com.logicaldoc.core.PersistentObjectDAO<Report>
      Overrides:
      initialize in class com.logicaldoc.core.HibernatePersistentObjectDAO<Report>
      Throws:
      com.logicaldoc.core.PersistenceException
    • isWriteAllowed

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

      public boolean isReadAllowed(long reportId, long userId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: ReportDAO
      This method is looking up for read rights for a report and an user
      Specified by:
      isReadAllowed in interface ReportDAO
      Parameters:
      reportId - ID of the note
      userId - ID of the user
      Returns:
      if the user can access the note
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database
    • getAllowedPermissions

      public Set<com.logicaldoc.core.security.Permission> getAllowedPermissions(long reportId, long userId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: ReportDAO
      Finds all permissions of a user enabled on the specified report
      Specified by:
      getAllowedPermissions in interface ReportDAO
      Parameters:
      reportId - ID of the report
      userId - ID of the user
      Returns:
      Collection of enabled permissions
      Throws:
      com.logicaldoc.core.PersistenceException - error at data layer
    • findByUser

      public List<Report> findByUser(long userId) throws com.logicaldoc.core.PersistenceException
      Description copied from interface: ReportDAO
      Finds the reports accessible by the given user
      Specified by:
      findByUser in interface ReportDAO
      Parameters:
      userId - identifier of the user
      Returns:
      the found reports
      Throws:
      com.logicaldoc.core.PersistenceException - Error in the database