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 TypeMethodDescriptionvoid
delete
(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 uservoid
This 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, 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, 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:PersistentObjectDAO
This method persists the entity object- Specified by:
store
in interfacePersistentObjectDAO<ApiKey>
- Overrides:
store
in classHibernatePersistentObjectDAO<ApiKey>
- Parameters:
apiKey
- entity to be stored- Throws:
PersistenceException
- raised in case of errors in the database
-
findByName
Description copied from interface:ApiKeyDAO
Finds the user's ApiKey with a given name- Specified by:
findByName
in 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:ApiKeyDAO
Finds the ApiKey by the unique key- Specified by:
findByKey
in 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:ApiKeyDAO
Finds the user's ApiKeys for a given user- Specified by:
findByUser
in 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:PersistentObjectDAO
This method deletes an entity and you can give a deletion code- Specified by:
delete
in interfacePersistentObjectDAO<ApiKey>
- Overrides:
delete
in classHibernatePersistentObjectDAO<ApiKey>
- Parameters:
id
- ID of the entity which should be deletedcode
- Deletion code- Throws:
PersistenceException
- raised in case of errors in the database
-