Package com.logicaldoc.core.metadata

# Class HibernateAttributeSetDAO

java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<AttributeSet>
com.logicaldoc.core.metadata.HibernateAttributeSetDAO

All Implemented Interfaces:
  `AttributeSetDAO`, `PersistentObjectDAO<AttributeSet>`

@Repository("attributeSetDAO") public class HibernateAttributeSetDAO extends HibernatePersistentObjectDAO<AttributeSet> implements AttributeSetDAO
Hibernate implementation of `TemplateDAO`

Since:
  7.5.0
Author:
  Marco Meschieri - LogicalDOC

## Field Summary

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

`ENTITY`

## Constructor Summary

Constructors
Constructor
Description
`HibernateAttributeSetDAO()`

## Method Summary

Modifier and Type
Method
Description
`void`
`delete(long id, int code)`
This method deletes an entity and you can give a deletion code
`List<AttributeSet>`
`findAll()`
Finds all entities in the database
`List<AttributeSet>`
`findAll(long tenantId)`
Finds all entities in a specific tenant.
`Map<String,Attribute>`
`findAttributes(long tenantId, Long setId)`
Gets the map of attributes defined in the given tenant or set
`AttributeSet`
`findByName(String name, long tenantId)`
This method finds a attribute set by name
`List<AttributeSet>`
`findByType(int type, long tenantId)`
This method finds a attribute set by type
`void`
`initialize(AttributeSet attributeSet)`
Doesn't do anything by default
`Map<Long,AttributeSet>`
`load(long tenantId)`
Retrieves all the attribute sets in a tenant
`void`
`store(AttributeSet set)`
This method persists the entity object

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

`bulkUpdate, count, deleteAll, evict, evict, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findIdsByWhere, getDatabaseMetadata, 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, deleteAll, deleteAll, evict, evict, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMariaDB, isMySQL, isOracle, isPostgreSQL, isSQLServer, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString`

## Constructor Details

### HibernateAttributeSetDAO

public HibernateAttributeSetDAO()

## Method Details

### findAll

public List<AttributeSet> findAll() throws PersistenceException
Description copied from interface: `PersistentObjectDAO`
Finds all entities in the database

Specified by:
  `findAll` in interface `PersistentObjectDAO<AttributeSet>`
Returns:
  The list of all entities
Throws:
  `PersistenceException` - Error in the database

### findAll

public List<AttributeSet> findAll(long tenantId) throws PersistenceException
Description copied from interface: `PersistentObjectDAO`
Finds all entities in a specific tenant.

Specified by:
  `findAll` in interface `PersistentObjectDAO<AttributeSet>`
Parameters:
  `tenantId` - Identifier of the tenant to search in
Returns:
  The list of all entities
Throws:
  `PersistenceException` - Error in the database

### findByName

public AttributeSet findByName(String name, long tenantId) throws PersistenceException
Description copied from interface: `AttributeSetDAO`
This method finds a attribute set by name

Specified by:
  `findByName` in interface `AttributeSetDAO`
Parameters:
  `name` - Name of the attribute set
  `tenantId` - ID of the owning tenant
Returns:
  AttributeSet with given name
Throws:
  `PersistenceException` - Error in the database

### delete

public void delete(long id, int code) throws PersistenceException
Description copied from interface: `PersistentObjectDAO`
This method deletes an entity and you can give a deletion code

Specified by:
  `delete` in interface `PersistentObjectDAO<AttributeSet>`
Overrides:
  `delete` in class `HibernatePersistentObjectDAO<AttributeSet>`
Parameters:
  `id` - ID of the entity which should be deleted
  `code` - Deletion code
Throws:
  `PersistenceException` - raised in case of errors in the database

### findByType

public List<AttributeSet> findByType(int type, long tenantId) throws PersistenceException
Description copied from interface: `AttributeSetDAO`
This method finds a attribute set by type

Specified by:
  `findByType` in interface `AttributeSetDAO`
Parameters:
  `type` - Type of the attribute set
  `tenantId` - ID of the owning tenant
Returns:
  AttributeSet with given type
Throws:
  `PersistenceException` - Error in the database

### store

public void store(AttributeSet set) throws PersistenceException
Description copied from interface: `PersistentObjectDAO`
This method persists the entity object

Specified by:
  `store` in interface `PersistentObjectDAO<AttributeSet>`
Overrides:
  `store` in class `HibernatePersistentObjectDAO<AttributeSet>`
Parameters:
  `set` - entity to be stored
Throws:
  `PersistenceException` - raised in case of errors in the database

### load

public Map<Long,AttributeSet> load(long tenantId) throws PersistenceException
Description copied from interface: `AttributeSetDAO`
Retrieves all the attribute sets in a tenant

Specified by:
  `load` in interface `AttributeSetDAO`
Parameters:
  `tenantId` - The tenant
Returns:
  Map ID-AttributeSet
Throws:
  `PersistenceException` - Error in the database

### findAttributes

public Map<String,Attribute> findAttributes(long tenantId, Long setId) throws PersistenceException
Description copied from interface: `AttributeSetDAO`
Gets the map of attributes defined in the given tenant or set

Specified by:
  `findAttributes` in interface `AttributeSetDAO`
Parameters:
  `tenantId` - The tenant ID
  `setId` - Optional set ID return map of attributes
Throws:
  `PersistenceException` - Error in the database

### initialize

public void initialize(AttributeSet attributeSet) throws PersistenceException
Description copied from class: `HibernatePersistentObjectDAO`
Doesn't do anything by default

Specified by:
  `initialize` in interface `PersistentObjectDAO<AttributeSet>`
Overrides:
  `initialize` in class `HibernatePersistentObjectDAO<AttributeSet>`
Parameters:
  `attributeSet` - The entity to be initialised
Throws:
  `PersistenceException` - Error in the database