Package com.logicaldoc.core.security.dao
Class HibernateUserHistoryDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<UserHistory>
-
- com.logicaldoc.core.security.dao.HibernateUserHistoryDAO
-
- All Implemented Interfaces:
PersistentObjectDAO<UserHistory>
,UserHistoryDAO
public class HibernateUserHistoryDAO extends HibernatePersistentObjectDAO<UserHistory> implements UserHistoryDAO
-
-
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.void
createUserHistory(User user, String eventType, String comment, String ip, String sessionId)
Creates an user history entryList<UserHistory>
findByUserId(long userId)
This method selects all histories of a given user.boolean
store(UserHistory history)
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<UserHistory> findByUserId(long userId)
Description copied from interface:UserHistoryDAO
This method selects all histories of a given user.- Specified by:
findByUserId
in interfaceUserHistoryDAO
- Parameters:
userId
- identifier of the suer- Returns:
- list of histories ordered by date
- See Also:
UserHistoryDAO.findByUserId(long)
-
createUserHistory
public void createUserHistory(User user, String eventType, String comment, String ip, String sessionId)
Description copied from interface:UserHistoryDAO
Creates an user history entry- Specified by:
createUserHistory
in interfaceUserHistoryDAO
- Parameters:
user
- The user that made the operationeventType
- The event typecomment
- The comment provided by the userip
- The remote IPsessionId
- The user session id- See Also:
UserHistoryDAO.createUserHistory(User, String, String, String, String)
-
cleanOldHistories
public void cleanOldHistories(int ttl)
Description copied from interface:UserHistoryDAO
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 interfaceUserHistoryDAO
- Parameters:
ttl
- The maximum number of days over which the history is considered old- See Also:
UserHistoryDAO.cleanOldHistories(int)
-
store
public boolean store(UserHistory history) throws PersistenceException
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<UserHistory>
- Overrides:
store
in classHibernatePersistentObjectDAO<UserHistory>
- Parameters:
history
- entity to be stored- Returns:
- True if successfully stored in a database
- Throws:
PersistenceException
- raised in case of errors in the database
-
-