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 of
FolderHistoryDAO
- Since:
- 6.4
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY
-
Method Summary
Modifier and TypeMethodDescriptionvoid
cleanOldHistories
(int ttl) This method deletes all the user history entries oldest than the given days from now.findByFolderId
(long folderId) This method selects all histories of a given folder.findByFolderIdAndEvent
(long folderId, String event, Date oldestDate) This method selects all histories of a given folder and event occurred after a given date.findByPath
(String pathExpression, Date oldestDate, Collection<String> events, Integer max) This method finds all histories about a path (you can use expression)findByUserId
(long userId) This method selects all histories of a given user.findByUserIdAndEvent
(long userId, String event) This method selects all histories of a given user and related to the given event.findNotNotified
(Integer max) This method selects all histories not notified yet.void
store
(FolderHistory history) This method persists the entity objectMethods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, 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, getDatabaseMetadata, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
-
Method Details
-
findByUserId
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
- Throws:
PersistenceException
- Error in the database
-
findByFolderId
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
- Throws:
PersistenceException
- Error in the database
-
findNotNotified
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
- Throws:
PersistenceException
- Error in the database
-
cleanOldHistories
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- Throws:
PersistenceException
- Error in the database
-
findByUserIdAndEvent
public List<FolderHistory> findByUserIdAndEvent(long userId, String event) throws PersistenceException 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
- Throws:
PersistenceException
- Error in the database
-
store
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<FolderHistory>
- Overrides:
store
in classHibernatePersistentObjectDAO<FolderHistory>
- Parameters:
history
- entity to be stored- Throws:
PersistenceException
- raised in case of errors in the database
-
findByPath
public List<FolderHistory> findByPath(String pathExpression, Date oldestDate, Collection<String> events, Integer max) throws PersistenceException 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%)oldestDate
- 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
- Throws:
PersistenceException
- Error in the data layer
-
findByFolderIdAndEvent
public List<FolderHistory> findByFolderIdAndEvent(long folderId, String event, Date oldestDate) throws PersistenceException 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
- Throws:
PersistenceException
- Error in the database
-