Class HibernateApiKeyDAO
java.lang.Object
com.logicaldoc.core.HibernatePersistentObjectDAO<ApiKey>
com.logicaldoc.core.security.apikey.HibernateApiKeyDAO
- All Implemented Interfaces:
PersistentObjectDAO<ApiKey>,ApiKeyDAO
Hibernate implementation of
ApiKeyDAO- Since:
- 8.9.4
- Author:
- Marco Meschieri - LogicalDOC
-
Field Summary
Fields inherited from interface com.logicaldoc.core.PersistentObjectDAO
ENTITY -
Method Summary
Modifier 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.HibernatePersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, getSessionFactory, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString, setSessionFactoryMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.logicaldoc.core.PersistentObjectDAO
bulkUpdate, delete, deleteAll, deleteAll, findAll, findAll, findAllIds, findAllIds, findById, findById, findByObjectQuery, findByQuery, findByWhere, findByWhere, findIdsByWhere, findIdsByWhere, getDatabaseMetadata, getDbms, initialize, isOracle, jdbcUpdate, jdbcUpdate, query, query, queryForDouble, queryForDouble, queryForInt, queryForInt, queryForList, queryForList, queryForList, queryForLong, queryForLong, queryForObject, queryForRowSet, queryForRowSet, queryForString
-
Method Details
-
store
Description copied from interface:PersistentObjectDAOThis method persists the entity object- Specified by:
storein interfacePersistentObjectDAO<ApiKey>- Overrides:
storein classHibernatePersistentObjectDAO<ApiKey>- Parameters:
apiKey- entity to be stored- Throws:
PersistenceException- raised in case of errors in the database
-
findByName
Description copied from interface:ApiKeyDAOFinds the user's ApiKey with a given name- Specified by:
findByNamein interfaceApiKeyDAO- Parameters:
name- the name of the ApiKeyuserId- the identifier of the user- Returns:
- The unique matching ApiKey
- Throws:
PersistenceException- Error in the database
-
findByKey
Description copied from interface:ApiKeyDAOFinds the ApiKey by the unique key- Specified by:
findByKeyin interfaceApiKeyDAO- Parameters:
key- the key to find- Returns:
- The unique matching ApiKey
- Throws:
PersistenceException- Error in the databaseNoSuchAlgorithmException- Error when encripting the key
-
findByUser
Description copied from interface:ApiKeyDAOFinds the user's ApiKeys for a given user- Specified by:
findByUserin interfaceApiKeyDAO- Parameters:
userId- the identifier of the user- Returns:
- The list of api keys ordered by name
- Throws:
PersistenceException- Error in the database
-
delete
Description copied from interface:PersistentObjectDAOThis method deletes an entity and you can give a deletion code- Specified by:
deletein interfacePersistentObjectDAO<ApiKey>- Overrides:
deletein classHibernatePersistentObjectDAO<ApiKey>- Parameters:
id- ID of the entity which should be deletedcode- Deletion code- Throws:
PersistenceException- raised in case of errors in the database
-