Package com.logicaldoc.core.folder
Class HibernateFolderHistoryDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<FolderHistory>
-
- com.logicaldoc.core.folder.HibernateFolderHistoryDAO
-
- All Implemented Interfaces:
FolderHistoryDAO
,PersistentObjectDAO<FolderHistory>
public class HibernateFolderHistoryDAO extends HibernatePersistentObjectDAO<FolderHistory> implements FolderHistoryDAO
Hibernate implementation ofFolderHistoryDAO
- Since:
- 6.4
- Author:
- Marco Meschieri - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
cleanOldHistories(int ttl)
This method deletes all the user history entries oldest than the given days from now.List<FolderHistory>
findByFolderId(long folderId)
This method selects all histories of a given folder.List<FolderHistory>
findByFolderIdAndEvent(long folderId, String event, Date oldestDate)
This method selects all histories of a given folder and event occurred after a given date.List<FolderHistory>
findByPath(String pathExpression, Date olderDate, Collection<String> events, Integer max)
This method finds all histories about a path (you can use expression)List<FolderHistory>
findByUserId(long userId)
This method selects all histories of a given user.List<FolderHistory>
findByUserIdAndEvent(long userId, String event)
This method selects all histories of a given user and related to the given event.List<FolderHistory>
findNotNotified(Integer max)
This method selects all histories not notified yet.boolean
store(FolderHistory entity)
This method persists the entity object-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, setSessionFactory
-
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, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString
-
-
-
-
Method Detail
-
findByUserId
public List<FolderHistory> findByUserId(long userId)
Description copied from interface:FolderHistoryDAO
This method selects all histories of a given user.- Specified by:
findByUserId
in interfaceFolderHistoryDAO
- Parameters:
userId
- identifier of the user- Returns:
- list of histories ordered by date
-
findByFolderId
public List<FolderHistory> findByFolderId(long folderId)
Description copied from interface:FolderHistoryDAO
This method selects all histories of a given folder.- Specified by:
findByFolderId
in interfaceFolderHistoryDAO
- Parameters:
folderId
- ID of the folder- Returns:
- list of histories ordered by date
-
findNotNotified
public List<FolderHistory> findNotNotified(Integer max)
Description copied from interface:FolderHistoryDAO
This method selects all histories not notified yet.- Specified by:
findNotNotified
in interfaceFolderHistoryDAO
- Parameters:
max
- Optional maximum number of records- Returns:
- list of histories ordered by date
-
cleanOldHistories
public void cleanOldHistories(int ttl)
Description copied from interface:FolderHistoryDAO
This method deletes all the user history entries oldest than the given days from now. Ifttl
is 0 or -1, the cancellation is not made.- Specified by:
cleanOldHistories
in interfaceFolderHistoryDAO
- Parameters:
ttl
- The maximum number of days over which the history is considered old
-
findByUserIdAndEvent
public List<FolderHistory> findByUserIdAndEvent(long userId, String event)
Description copied from interface:FolderHistoryDAO
This method selects all histories of a given user and related to the given event.- Specified by:
findByUserIdAndEvent
in interfaceFolderHistoryDAO
- Parameters:
userId
- The user identifierevent
- The history event- Returns:
- list of histories ordered by date
-
store
public boolean store(FolderHistory entity) throws PersistenceException
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<FolderHistory>
- Overrides:
store
in classHibernatePersistentObjectDAO<FolderHistory>
- Parameters:
entity
- entity to be stored- Returns:
- True if successfully stored in a database
- Throws:
PersistenceException
- raised in case of errors in the database
-
findByPath
public List<FolderHistory> findByPath(String pathExpression, Date olderDate, Collection<String> events, Integer max)
Description copied from interface:FolderHistoryDAO
This method finds all histories about a path (you can use expression)- Specified by:
findByPath
in interfaceFolderHistoryDAO
- Parameters:
pathExpression
- The path expression (like /Default/acme%)olderDate
- The older date for the retrieved historiesevents
- Optional list of event codes to be used as filtermax
- Optional maximum number of records- Returns:
- The list of histories that matched the given criteria
-
findByFolderIdAndEvent
public List<FolderHistory> findByFolderIdAndEvent(long folderId, String event, Date oldestDate)
Description copied from interface:FolderHistoryDAO
This method selects all histories of a given folder and event occurred after a given date.- Specified by:
findByFolderIdAndEvent
in interfaceFolderHistoryDAO
- Parameters:
folderId
- ID of the folderevent
- code of the event to searcholdestDate
- optional oldest date- Returns:
- list of histories ordered by date
-
-