Package com.logicaldoc.core.generic

# Interface GenericDAO

All Superinterfaces:
  `PersistentObjectDAO<Generic>`

All Known Implementing Classes:
  `HibernateGenericDAO`

public interface GenericDAO extends PersistentObjectDAO<Generic>
Instances of this class is a DAO-service for Generic business entities.

Since:
  4.0
Author:
  Marco Meschieri - LogicalDOC

## Field Summary

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

`ENTITY`

## Method Summary

Modifier and Type
Method
Description
`Generic`
`findByAlternateKey(String type, String subtype, Long qualifier, long tenantId)`
Finds a Generic by it's alternate key
`List<Generic>`
`findByTypeAndSubtype(String type, String subtype, Long qualifier, Long tenantId)`
Finds a Generic by it's alternate key.
`static GenericDAO`
`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 GenericDAO get()
Gets the object available in the application context

Returns:
  the instance of this object in the application context

### findByAlternateKey

Generic findByAlternateKey(String type, String subtype, Long qualifier, long tenantId) throws PersistenceException
Finds a Generic by it's alternate key

Parameters:
  `type` - The type(you can use like jollies and can be null)
  `subtype` - The sub-type(you can use like jollies and can be null)
  `qualifier` - the qualifier, can be null
  `tenantId` - ID of the owning tenant
Returns:
  Wanted generic or null
Throws:
  `PersistenceException` - Error in the database

### findByTypeAndSubtype

List<Generic> findByTypeAndSubtype(String type, String subtype, Long qualifier, Long tenantId) throws PersistenceException
Finds a Generic by it's alternate key. The search uses the like operator and each parameter can be null.

Parameters:
  `type` - The type(you can use like jollies and can be null)
  `subtype` - The sub-type(you can use like jollies and can be null)
  `qualifier` - the qualifier, can be null
  `tenantId` - ID of the owning tenant (optional)
Returns:
  The collection of found Generics
Throws:
  `PersistenceException` - Error in the database