Package com.logicaldoc.core.security

# Class HibernateTenantDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<Tenant>
com.logicaldoc.core.security.HibernateTenantDAO

All Implemented Interfaces:
  `PersistentObjectDAO<Tenant>`, `TenantDAO`

@Repository("tenantDAO") public class HibernateTenantDAO extends HibernatePersistentObjectDAO<Tenant> implements TenantDAO

## Field Summary

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

`ENTITY`

## Method Summary

Modifier and Type
Method
Description
`Set<String>`
`findAllNames()`
Retrieves all the tenant names
`Tenant`
`findByName(String name)`
Finds a tenant by name
`String`
`getTenantName(long tenantId)`
Retrieves the tenant's name
`void`
`store(Tenant entity)`
This method persists the entity object

### Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO

`bulkUpdate, count, delete, deleteAll, evict, evict, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findIdsByWhere, getDatabaseMetadata, initialize, jdbcUpdate, jdbcUpdate, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, 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, 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`

## Method Details

### findByName

public Tenant findByName(String name)
Description copied from interface: `TenantDAO`
Finds a tenant by name

Specified by:
  `findByName` in interface `TenantDAO`
Parameters:
  `name` - name of wanted tenant
Returns:
  Wanted tenant or null

### findAllNames

public Set<String> findAllNames() throws PersistenceException
Description copied from interface: `TenantDAO`
Retrieves all the tenant names

Specified by:
  `findAllNames` in interface `TenantDAO`
Returns:
  the collection of all the tenant names
Throws:
  `PersistenceException` - Error in the database

### store

public void store(Tenant entity)
Description copied from interface: `PersistentObjectDAO`
This method persists the entity object

Specified by:
  `store` in interface `PersistentObjectDAO<Tenant>`
Overrides:
  `store` in class `HibernatePersistentObjectDAO<Tenant>`
Parameters:
  `entity` - entity to be stored

### getTenantName

public String getTenantName(long tenantId) throws PersistenceException
Description copied from interface: `TenantDAO`
Retrieves the tenant's name

Specified by:
  `getTenantName` in interface `TenantDAO`
Parameters:
  `tenantId` - identifier of the tenant
Returns:
  name of the tenant
Throws:
  `PersistenceException` - Error in the database