Class HibernatePersonalInformationDao
- java.lang.Object
-
- org.springframework.dao.support.DaoSupport
-
- com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao<T>
-
- com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao<T>
-
- com.atlassian.confluence.core.persistence.hibernate.ConfluenceHibernateObjectDao<PersonalInformation>
-
- com.atlassian.confluence.user.persistence.dao.hibernate.HibernatePersonalInformationDao
-
- All Implemented Interfaces:
ObjectDao
,VersionedObjectDao<PersonalInformation>
,PersonalInformationBulkDao
,ObjectDaoInternal<PersonalInformation>
,VersionedObjectDaoInternal<PersonalInformation>
,PersonalInformationDaoInternal
,PersonalInformationDao
,org.springframework.beans.factory.InitializingBean
@ParametersAreNonnullByDefault public class HibernatePersonalInformationDao extends ConfluenceHibernateObjectDao<PersonalInformation> implements PersonalInformationDaoInternal, PersonalInformationBulkDao
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
HibernateObjectDao.Cacheability
-
-
Field Summary
-
Fields inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
cacheFactory, confluenceUserDao
-
-
Constructor Summary
Constructors Constructor Description HibernatePersonalInformationDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Collection<PersonalInformation>
bulkFetchPersonalInformation(Collection<com.atlassian.sal.api.user.UserKey> userKeys)
Bulk-fetches all PersonalInformation entities for the given UserKeys.@NonNull List<Long>
findIdsWithAssociatedUser()
List<PersonalInformation>
getAllByUser(@Nullable ConfluenceUser user)
Workaround for duplicate personal information.protected PersonalInformation
getByClassId(long id)
Retrieve the object with a particular id from the database.PersonalInformation
getById(long id)
Returns the personal information object with the given ID.PersonalInformation
getByUser(@Nullable ConfluenceUser user)
Fetches a personal information object for the specified user.Class<PersonalInformation>
getPersistentClass()
Gets the type ofEntityObject
this Dao works with.-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.VersionedHibernateObjectDao
findAllSorted, findLatestVersionsCount, findLatestVersionsCount, findLatestVersionsIterator, findLatestVersionsIterator, findNamedQueryStringParams, findNamedQueryStringParams, save, saveEntity, setCacheFactory, setConfluenceUserDao, updateEntityModificationData, updateModificationData
-
Methods inherited from class com.atlassian.confluence.core.persistence.hibernate.HibernateObjectDao
applyTransactionTimeout, applyTransactionTimeout, checkDaoConfig, createHibernateTemplate, findAll, findAllSorted, findByClassIds, findByClassIdsFiltered, findNamedQuery, findNamedQuery, findNamedQuery, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParam, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findNamedQueryStringParams, findSingleObject, getCountResult, getHibernateTemplate, getSessionFactory, index, indexEntity, refresh, refreshEntity, reIndex, reIndexEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity, setEventPublisher, setHibernateTemplate, setIndexer, setSessionFactory, unIndex, unIndexEntity, uniqueResult
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.atlassian.confluence.internal.persistence.ObjectDaoInternal
findAll, findAllSorted, findAllSorted, findByClassIds, findByClassIdsFiltered, refresh, refreshEntity, remove, removeEntity, replicate, replicateEntity, save, saveEntity, saveRaw, saveRawEntity
-
-
-
-
Method Detail
-
getByUser
public PersonalInformation getByUser(@Nullable ConfluenceUser user)
Fetches a personal information object for the specified user. To get a properly initialized personal information object, please usePersonalInformationManager.getOrCreatePersonalInformation(User)
.- Specified by:
getByUser
in interfacePersonalInformationDao
- Since:
- 5.2
-
getAllByUser
public List<PersonalInformation> getAllByUser(@Nullable ConfluenceUser user)
Description copied from interface:PersonalInformationDao
Workaround for duplicate personal information. Remove when that's fixed.- Specified by:
getAllByUser
in interfacePersonalInformationDao
-
getById
public PersonalInformation getById(long id)
Description copied from interface:PersonalInformationDao
Returns the personal information object with the given ID.- Specified by:
getById
in interfacePersonalInformationDao
-
findIdsWithAssociatedUser
public @NonNull List<Long> findIdsWithAssociatedUser()
- Specified by:
findIdsWithAssociatedUser
in interfacePersonalInformationDao
- Returns:
- all personal information ids having associated user
-
getByClassId
protected PersonalInformation getByClassId(long id)
Description copied from class:HibernateObjectDao
Retrieve the object with a particular id from the database. The object must be of the same class as the DAO's getPersistentClass() method returns.- Overrides:
getByClassId
in classHibernateObjectDao<PersonalInformation>
- Parameters:
id
- the id of the object to look up- Returns:
- the corresponding object, or null if the object does not exist with the appropriate class and id.
-
getPersistentClass
public Class<PersonalInformation> getPersistentClass()
Description copied from interface:ObjectDaoInternal
Gets the type ofEntityObject
this Dao works with.- Specified by:
getPersistentClass
in interfaceObjectDao
- Specified by:
getPersistentClass
in interfaceObjectDaoInternal<PersonalInformation>
- Returns:
- the type
-
bulkFetchPersonalInformation
public Collection<PersonalInformation> bulkFetchPersonalInformation(Collection<com.atlassian.sal.api.user.UserKey> userKeys)
Bulk-fetches all PersonalInformation entities for the given UserKeys. This query also does an eager fetch on the associated ConfluenceUserImpl object.- Specified by:
bulkFetchPersonalInformation
in interfacePersonalInformationBulkDao
- Returns:
- a collection containing at-most one
PersonalInformation
object for each user
-
-