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>
public class HibernateAttributeOptionDAO extends HibernatePersistentObjectDAO<AttributeOption> implements AttributeOptionDAO
Hibernate implementation ofAttributeOptionDAO
- Since:
- 7.1
- Author:
- Marco Meschieri - LogicalDOC
-
-
Constructor Summary
Constructors Constructor Description HibernateAttributeOptionDAO()
-
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 codeboolean
deleteBySetIdAndAttribute(long setId, String attribute)
This method deletes options.void
deleteOrphaned(long setId, Collection<String> currentAttributes)
This method deletes the orphaned options of a given templateList<AttributeOption>
findBySetIdAndAttribute(long setId, String attribute)
This finds all the options for a given attribute.-
Methods inherited from class com.logicaldoc.core.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, 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, store
-
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, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, queryForInt, queryForList, queryForList, queryForLong, queryForObject, queryForRowSet, queryForString, store
-
-
-
-
Method Detail
-
deleteBySetIdAndAttribute
public boolean deleteBySetIdAndAttribute(long setId, String attribute)
Description copied from interface:AttributeOptionDAO
This method deletes options.- Specified by:
deleteBySetIdAndAttribute
in interfaceAttributeOptionDAO
- Parameters:
setId
- ID of the attribute setattribute
- Name of the attribute (optional)- Returns:
- if all went ok
-
findBySetIdAndAttribute
public List<AttributeOption> findBySetIdAndAttribute(long setId, String attribute)
Description copied from interface:AttributeOptionDAO
This finds all the options for a given attribute. The list is ordered by position asc.- Specified by:
findBySetIdAndAttribute
in interfaceAttributeOptionDAO
- Parameters:
setId
- The attribute set idattribute
- The attribute name (Optional)- Returns:
- The ordered list of options
-
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<AttributeOption>
- Overrides:
delete
in classHibernatePersistentObjectDAO<AttributeOption>
- Parameters:
id
- ID of the entity which should be deletedcode
- Deletion code- Returns:
- if the record has been successfully deleted
-
deleteOrphaned
public void deleteOrphaned(long setId, Collection<String> currentAttributes)
Description copied from interface:AttributeOptionDAO
This method deletes the orphaned options of a given template- Specified by:
deleteOrphaned
in interfaceAttributeOptionDAO
- Parameters:
setId
- ID of the attribute setcurrentAttributes
- Names of the attributes of the actual template
-
-