Class HibernateApiKeyDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<ApiKey>
com.logicaldoc.core.security.apikey.HibernateApiKeyDAO
- All Implemented Interfaces:
- PersistentObjectDAO<ApiKey>,- ApiKeyDAO
@Repository("apiKeyDAO")
public class HibernateApiKeyDAO
extends HibernatePersistentObjectDAO<ApiKey>
implements ApiKeyDAO
Hibernate implementation of 
ApiKeyDAO- Since:
- 8.9.4
- Author:
- Marco Meschieri - LogicalDOC
- 
Field SummaryFields inherited from interface com.logicaldoc.core.PersistentObjectDAOENTITY
- 
Method SummaryModifier and TypeMethodDescriptionvoiddelete(long id, int code) This method deletes an entity and you can give a deletion codeFinds the ApiKey by the unique keyfindByName(String name, long userId) Finds the user's ApiKey with a given namefindByUser(long userId) Finds the user's ApiKeys for a given uservoidThis method persists the entity objectMethods 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, setSessionFactoryMethods 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
- 
Method Details- 
storeDescription copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
- storein interface- PersistentObjectDAO<ApiKey>
- Overrides:
- storein class- HibernatePersistentObjectDAO<ApiKey>
- Parameters:
- apiKey- entity to be stored
- Throws:
- PersistenceException- raised in case of errors in the database
 
- 
findByNameDescription copied from interface:ApiKeyDAOFinds the user's ApiKey with a given name- Specified by:
- findByNamein interface- ApiKeyDAO
- Parameters:
- name- the name of the ApiKey
- userId- the identifier of the user
- Returns:
- The unique matching ApiKey
- Throws:
- PersistenceException- Error in the database
 
- 
findByKeyDescription copied from interface:ApiKeyDAOFinds the ApiKey by the unique key- Specified by:
- findByKeyin interface- ApiKeyDAO
- Parameters:
- key- the key to find
- Returns:
- The unique matching ApiKey
- Throws:
- PersistenceException- Error in the database
- NoSuchAlgorithmException- Error when encripting the key
 
- 
findByUserDescription copied from interface:ApiKeyDAOFinds the user's ApiKeys for a given user- Specified by:
- findByUserin interface- ApiKeyDAO
- Parameters:
- userId- the identifier of the user
- Returns:
- The list of api keys ordered by name
- 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<ApiKey>
- Overrides:
- deletein class- HibernatePersistentObjectDAO<ApiKey>
- Parameters:
- id- ID of the entity which should be deleted
- code- Deletion code
- Throws:
- PersistenceException- raised in case of errors in the database
 
 
-