Class HibernateSearchDAO
- java.lang.Object
-
- com.logicaldoc.core.HibernatePersistentObjectDAO<SavedSearch>
-
- com.logicaldoc.core.searchengine.saved.HibernateSearchDAO
-
- All Implemented Interfaces:
PersistentObjectDAO<SavedSearch>,SearchDAO
public class HibernateSearchDAO extends HibernatePersistentObjectDAO<SavedSearch> implements SearchDAO
Hibernate implementation ofSearchDAO- Since:
- 8.6.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleandelete(long id, int code)This method deletes an entity and you can give a deletion codeList<SavedSearch>findByUserId(long userId)Gets all the searches of a given user ordered by name ascSavedSearchfindByUserIdAndName(long userId, String name)Gets the search using the alternate keybooleanstore(SavedSearch search)This method persists the entity object-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, 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, 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<SavedSearch> findByUserId(long userId) throws PersistenceException
Description copied from interface:SearchDAOGets all the searches of a given user ordered by name asc- Specified by:
findByUserIdin interfaceSearchDAO- Parameters:
userId- Identifier of the user- Returns:
- orderer list of searches
- Throws:
PersistenceException- Error in the database
-
findByUserIdAndName
public SavedSearch findByUserIdAndName(long userId, String name) throws PersistenceException
Description copied from interface:SearchDAOGets the search using the alternate key- Specified by:
findByUserIdAndNamein interfaceSearchDAO- Parameters:
userId- Identifier of the username- The name of the search- Returns:
- the found search record, if any
- Throws:
PersistenceException- Error in the database
-
delete
public boolean delete(long id, int code) throws PersistenceExceptionDescription copied from interface:PersistentObjectDAOThis method deletes an entity and you can give a deletion code- Specified by:
deletein interfacePersistentObjectDAO<SavedSearch>- Overrides:
deletein classHibernatePersistentObjectDAO<SavedSearch>- Parameters:
id- ID of the entity which should be deletedcode- Deletion code- Returns:
- if the record has been successfully deleted
- Throws:
PersistenceException- raised in case of errors in the database
-
store
public boolean store(SavedSearch search) throws PersistenceException
Description copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
storein interfacePersistentObjectDAO<SavedSearch>- Overrides:
storein classHibernatePersistentObjectDAO<SavedSearch>- Parameters:
search- entity to be stored- Returns:
- True if successfully stored in a database
- Throws:
PersistenceException- raised in case of errors in the database
-
-