Package com.logicaldoc.core.searchengine.saved

# Interface SearchDAO

All Superinterfaces:
  `PersistentObjectDAO<SavedSearch>`

All Known Implementing Classes:
  `HibernateSearchDAO`

public interface SearchDAO extends PersistentObjectDAO<SavedSearch>
This class is a DAO-service for persistent `SavedSearch` objects.

Since:
  8.6.1
Author:
  Marco Meschieri - LogicalDOC

## Field Summary

### Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO

`ENTITY`

## Method Summary

Modifier and Type
Method
Description
`List<SavedSearch>`
`findByUserId(long userId)`
Gets all the searches of a given user ordered by name asc
`SavedSearch`
`findByUserIdAndName(long userId, String name)`
Gets the search using the alternate key
`static SearchDAO`
`get()`
Gets the object available in the application context

### Methods inherited from interface com.logicaldoc.core.PersistentObjectDAO

`bulkUpdate, count, count, count, delete, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, initialize, isMariaDB, isMySQL, isOracle, isPostgreSQL, isSQLServer, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store`

## Method Details

### get

static SearchDAO get()
Gets the object available in the application context

Returns:
  the instance of this object in the application context

### findByUserIdAndName

SavedSearch findByUserIdAndName(long userId, String name) throws PersistenceException
Gets the search using the alternate key

Parameters:
  `userId` - Identifier of the user
  `name` - The name of the search
Returns:
  the found search gridRecord, if any
Throws:
  `PersistenceException` - Error in the database

### findByUserId

List<SavedSearch> findByUserId(long userId) throws PersistenceException
Gets all the searches of a given user ordered by name asc

Parameters:
  `userId` - Identifier of the user
Returns:
  orderer list of searches
Throws:
  `PersistenceException` - Error in the database