Package com.logicaldoc.core.metadata
Class HibernateAttributeOptionDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<AttributeOption>
com.logicaldoc.core.metadata.HibernateAttributeOptionDAO
- All Implemented Interfaces:
- AttributeOptionDAO,- PersistentObjectDAO<AttributeOption>
@Repository("attributeOptionDAO")
public class HibernateAttributeOptionDAO
extends HibernatePersistentObjectDAO<AttributeOption>
implements AttributeOptionDAO
Hibernate implementation of 
AttributeOptionDAO- Since:
- 7.1
- Author:
- Marco Meschieri - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionvoiddelete(long id, int code) This method deletes an entity and you can give a deletion codevoiddeleteBySetIdAndAttribute(long setId, String attribute) This method deletes options.voiddeleteOrphaned(long setId, Collection<String> currentAttributes) This method deletes the orphaned options of a given templatefindByAttribute(long setId, String attribute) This finds all the options for a given attribute.findByAttributeAndCategory(long setId, String attribute, String category) This finds all the options for a given attribute.findByAttributeAsMap(long setId, String attribute) This finds all the options for a given attribute and groups them by category.Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAObulkUpdate, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, setSessionFactory, storeMethods inherited from class java.lang.Objectequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logicaldoc.core.PersistentObjectDAObulkUpdate, delete, deleteAll, deleteAll, evict, evict, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isMySQL, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForObject, queryForResultSet, queryForString, queryForString, store
- 
Constructor Details- 
HibernateAttributeOptionDAOpublic HibernateAttributeOptionDAO()
 
- 
- 
Method Details- 
deleteBySetIdAndAttributeDescription copied from interface:AttributeOptionDAOThis method deletes options.- Specified by:
- deleteBySetIdAndAttributein interface- AttributeOptionDAO
- Parameters:
- setId- ID of the attribute set
- attribute- Name of the attribute (optional)
- Throws:
- PersistenceException- Error in the database
 
- 
findByAttributepublic List<AttributeOption> findByAttribute(long setId, String attribute) throws PersistenceException Description copied from interface:AttributeOptionDAOThis finds all the options for a given attribute. The list is ordered by position asc.- Specified by:
- findByAttributein interface- AttributeOptionDAO
- Parameters:
- setId- The attribute set id
- attribute- The attribute name (Optional)
- Returns:
- The ordered list of options
- Throws:
- PersistenceException- Error in the database
 
- 
findByAttributeAndCategorypublic List<AttributeOption> findByAttributeAndCategory(long setId, String attribute, String category) throws PersistenceException Description copied from interface:AttributeOptionDAOThis finds all the options for a given attribute. The list is ordered by position asc.- Specified by:
- findByAttributeAndCategoryin interface- AttributeOptionDAO
- Parameters:
- setId- The attribute set id
- attribute- The attribute name (Optional)
- category- The category (Optional)
- Returns:
- The ordered list of options
- Throws:
- PersistenceException- Error in the database
 
- 
findByAttributeAsMappublic Map<String,List<AttributeOption>> findByAttributeAsMap(long setId, String attribute) throws PersistenceException Description copied from interface:AttributeOptionDAOThis finds all the options for a given attribute and groups them by category. The list is ordered by position asc.- Specified by:
- findByAttributeAsMapin interface- AttributeOptionDAO
- Parameters:
- setId- The attribute set id
- attribute- The attribute name
- Returns:
- The map of opions, key is the category
- Throws:
- PersistenceException- Error in the database
 
- 
deleteDescription copied from interface:PersistentObjectDAOThis method deletes an entity and you can give a deletion code- Specified by:
- deletein interface- PersistentObjectDAO<AttributeOption>
- Overrides:
- deletein class- HibernatePersistentObjectDAO<AttributeOption>
- Parameters:
- id- ID of the entity which should be deleted
- code- Deletion code
- Throws:
- PersistenceException- raised in case of errors in the database
 
- 
deleteOrphanedpublic void deleteOrphaned(long setId, Collection<String> currentAttributes) throws PersistenceException Description copied from interface:AttributeOptionDAOThis method deletes the orphaned options of a given template- Specified by:
- deleteOrphanedin interface- AttributeOptionDAO
- Parameters:
- setId- ID of the attribute set
- currentAttributes- Names of the attributes of the actual template
- Throws:
- PersistenceException- Error in the database
 
 
-