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>
public class HibernateAttributeSetDAO extends HibernatePersistentObjectDAO<AttributeSet> implements AttributeSetDAO
Hibernate implementation ofTemplateDAO
- Since:
- 7.5.0
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description HibernateAttributeSetDAO()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
delete(long id, int code)
This method deletes an entity and you can give a deletion codeList<AttributeSet>
findAll()
Finds all entities in the databaseList<AttributeSet>
findAll(long tenantId)
Finds all entities in a specific tenant.Map<String,Attribute>
findAttributes(long tenantId, Long setId)
Returns a TreeMap so the key set is alphabetically orderedAttributeSet
findByName(String name, long tenantId)
This method finds a attribute set by nameList<AttributeSet>
findByType(int type, long tenantId)
This method finds a attribute set by typeMap<Long,AttributeSet>
load(long tenantId)
Retrieves all the attribute sets in a tenantvoid
setOptionsDao(AttributeOptionDAO optionsDao)
void
setTemplateDao(TemplateDAO templateDao)
boolean
store(AttributeSet set)
This method persists the entity object-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, 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, 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
-
findAll
public List<AttributeSet> findAll()
Description copied from interface:PersistentObjectDAO
Finds all entities in the database- Specified by:
findAll
in interfacePersistentObjectDAO<AttributeSet>
- Overrides:
findAll
in classHibernatePersistentObjectDAO<AttributeSet>
- Returns:
- The list of all entities
-
findAll
public List<AttributeSet> findAll(long tenantId)
Description copied from interface:PersistentObjectDAO
Finds all entities in a specific tenant.- Specified by:
findAll
in interfacePersistentObjectDAO<AttributeSet>
- Overrides:
findAll
in classHibernatePersistentObjectDAO<AttributeSet>
- Parameters:
tenantId
- Identifier of the tenant to search in- Returns:
- The list of all entities
-
findByName
public AttributeSet findByName(String name, long tenantId)
Description copied from interface:AttributeSetDAO
This method finds a attribute set by name- Specified by:
findByName
in interfaceAttributeSetDAO
- Parameters:
name
- Name of the attribute settenantId
- ID of the owning tenant- Returns:
- AttributeSet with given name
-
delete
public boolean delete(long id, int code)
Description copied from interface:PersistentObjectDAO
This method deletes an entity and you can give a deletion code- Specified by:
delete
in interfacePersistentObjectDAO<AttributeSet>
- Overrides:
delete
in classHibernatePersistentObjectDAO<AttributeSet>
- Parameters:
id
- ID of the entity which should be deletedcode
- Deletion code- Returns:
- if the record has been successfully deleted
-
findByType
public List<AttributeSet> findByType(int type, long tenantId)
Description copied from interface:AttributeSetDAO
This method finds a attribute set by type- Specified by:
findByType
in interfaceAttributeSetDAO
- Parameters:
type
- Type of the attribute settenantId
- ID of the owning tenant- Returns:
- AttributeSet with given type
-
setOptionsDao
public void setOptionsDao(AttributeOptionDAO optionsDao)
-
store
public boolean store(AttributeSet set) throws PersistenceException
Description copied from interface:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<AttributeSet>
- Overrides:
store
in classHibernatePersistentObjectDAO<AttributeSet>
- Parameters:
set
- entity to be stored- Returns:
- True if successfully stored in a database
- Throws:
PersistenceException
- raised in case of errors in the database
-
setTemplateDao
public void setTemplateDao(TemplateDAO templateDao)
-
load
public Map<Long,AttributeSet> load(long tenantId)
Description copied from interface:AttributeSetDAO
Retrieves all the attribute sets in a tenant- Specified by:
load
in interfaceAttributeSetDAO
- Parameters:
tenantId
- The tenant- Returns:
- Map ID-AttributeSet
-
findAttributes
public Map<String,Attribute> findAttributes(long tenantId, Long setId)
Returns a TreeMap so the key set is alphabetically ordered- Specified by:
findAttributes
in interfaceAttributeSetDAO
- Parameters:
tenantId
- The tenant IDsetId
- Optional set ID- Returns:
- map of attributes
-
-