public class AliasDAOHibernate extends HibernateDao<Alias> implements AliasDAO
batchFinder, batchProcessor, logger, statelessSessionBatchProcessor, timeSource
sessionFactory
Constructor and Description |
---|
AliasDAOHibernate() |
Modifier and Type | Method and Description |
---|---|
String |
findAliasByUsername(Application application,
String username)
Retrieves the application-specific alias for a username.
|
List<Alias> |
findAliasesForUsers(Application application,
Iterable<String> userNames)
Retrieves application-specific aliases for the specified users
|
List<Alias> |
findAll() |
String |
findUsernameByAlias(Application application,
String alias)
Retrieves the real username for a user in a directory given their application-specific alias.
|
Class<Alias> |
getPersistentClass()
All subclasses of HibernateDao must implement this method for
HibernateDao.load(Serializable) to work
correctly. |
void |
removeAlias(Application application,
String username)
Remove an application-specific alias for a username.
|
void |
removeAliases(Application application)
Removes all the username-aliases for a specific application.
|
void |
removeAliasesForUser(String username)
Removes all the aliases registered for a given username in all applications (there may be different users)
|
List<String> |
search(EntityQuery<String> entityQuery)
Will search for a List of Alias' based on a given
EntityQuery |
void |
setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater) |
void |
storeAlias(Application application,
String username,
String alias)
Add or update the application-specific alias for a username.
|
createDeleteQuery, createDeleteQuery, createQuery, createQuery, executeHQLQuery, executeHQLQuery, findAllInternal, findByProperties, findByPropertiesOptional, findByProperty, findByProperty, findByPropertyOptional, findByPropertyOrThrow, getCountByProperties, load, load, loadOptional, loadReference, loadReference, remove, removeByIdIfPresent, save, saveOrUpdate, session, setBatchFinder, setBatchProcessor, setClock, setStatelessSessionBatchProcessor, toPredicates, update
setSessionFactory, withStatelessSession
public String findAliasByUsername(Application application, String username)
AliasDAO
findAliasByUsername
in interface AliasDAO
application
- application context.username
- real username of user in directory.null
if there is no alias for the user/application.public String findUsernameByAlias(Application application, String alias)
AliasDAO
findUsernameByAlias
in interface AliasDAO
application
- application context.alias
- application-specific alias.null
if there is no user with the supplied alias for the given application.public Class<Alias> getPersistentClass()
HibernateDao
HibernateDao.load(Serializable)
to work
correctly.getPersistentClass
in class HibernateDao<Alias>
public void removeAlias(Application application, String username)
AliasDAO
removeAlias
in interface AliasDAO
application
- application context.username
- real username of user in directory.public void removeAliases(Application application)
AliasDAO
removeAliases
in interface AliasDAO
application
- application context.public List<String> search(EntityQuery<String> entityQuery)
AliasDAO
EntityQuery
search
in interface AliasDAO
entityQuery
- an entity query of type EntityDescriptor.alias()
public void storeAlias(Application application, String username, String alias)
AliasDAO
storeAlias
in interface AliasDAO
application
- application context.username
- real username of user in directory.alias
- application-specific alias (cannot be null
or blank).public List<Alias> findAliasesForUsers(Application application, Iterable<String> userNames)
AliasDAO
findAliasesForUsers
in interface AliasDAO
application
- application contextuserNames
- the users for which the aliases should be retrievedpublic void removeAliasesForUser(String username)
AliasDAO
removeAliasesForUser
in interface AliasDAO
@Autowired public void setHqlQueryTranslater(HQLQueryTranslater hqlQueryTranslater)
Copyright © 2020 Atlassian. All rights reserved.