@ParametersAreNonnullByDefault public class CachingPersonalInformationDao extends Object implements PersonalInformationDao, PersonalInformationBulkDao
There is a potential race condition in the cache, where creating two personal information objects at approximately the same time will lead to this cache returning the
NON_CACHEABLE
Constructor and Description |
---|
CachingPersonalInformationDao(PersonalInformationDao delegateDao,
com.atlassian.vcache.VCacheFactory cacheFactory) |
Modifier and Type | Method and Description |
---|---|
Collection<PersonalInformation> |
bulkFetchPersonalInformation(Collection<com.atlassian.sal.api.user.UserKey> userKeys)
Delegates immediately to the database, and then adds each of the results to the cache.
|
List |
findAll()
Find all objects currently persisted of a particular type.
|
List |
findAllSorted(String s)
Find all objects currently persisted of a particular type and sort results by named property.
|
List |
findAllSorted(String s,
boolean cached,
int firstRow,
int maxRows)
Find all objects currently persisted of a particular type and sort results by named property.
|
<T> PageResponse<T> |
findByClassIds(Iterable<Long> ids,
LimitedRequest limitedRequest,
com.google.common.base.Predicate<? super T> filter)
Find a list of objects from the same persistent class.
|
List<Long> |
findIdsWithAssociatedUser() |
List<PersonalInformation> |
getAllByUser(ConfluenceUser user)
Workaround for duplicate personal information.
|
PersonalInformation |
getById(long id)
Returns the personal information object with the given ID.
|
PersonalInformation |
getByUser(ConfluenceUser user)
Fetches the personal information object for this user.
|
PersonalInformation |
getByUsername(String username)
Deprecated.
|
Class |
getPersistentClass() |
void |
refresh(com.atlassian.core.bean.EntityObject objectToRrfresh)
Refreshes the object again with the fresh data from db.
|
void |
remove(com.atlassian.core.bean.EntityObject object)
Remove object from persistence.
|
void |
replicate(Object objectToReplicate)
Replicate the object.
|
void |
save(com.atlassian.core.bean.EntityObject objectToSave) |
void |
saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
saves the object.
|
public CachingPersonalInformationDao(PersonalInformationDao delegateDao, com.atlassian.vcache.VCacheFactory cacheFactory)
public PersonalInformation getByUser(ConfluenceUser user)
PersonalInformationDao
getByUser
in interface PersonalInformationDao
public List<PersonalInformation> getAllByUser(ConfluenceUser user)
PersonalInformationDao
getAllByUser
in interface PersonalInformationDao
@Deprecated public PersonalInformation getByUsername(String username)
getByUsername
in interface PersonalInformationDao
public PersonalInformation getById(long id)
PersonalInformationDao
getById
in interface PersonalInformationDao
@Nonnull public List<Long> findIdsWithAssociatedUser()
findIdsWithAssociatedUser
in interface PersonalInformationDao
public Collection<PersonalInformation> bulkFetchPersonalInformation(Collection<com.atlassian.sal.api.user.UserKey> userKeys)
bulkFetchPersonalInformation
in interface PersonalInformationBulkDao
PersonalInformation
object for each userpublic void remove(com.atlassian.core.bean.EntityObject object)
ObjectDao
public void refresh(com.atlassian.core.bean.EntityObject objectToRrfresh)
ObjectDao
public void replicate(Object objectToReplicate)
ObjectDao
@Nonnull public List findAll()
ObjectDao
@Nonnull public List findAllSorted(String s)
ObjectDao
findAllSorted
in interface ObjectDao
s
- the name of the property to be sorted on. This should be null if no sorting is required.@Nonnull public List findAllSorted(String s, boolean cached, int firstRow, int maxRows)
ObjectDao
findAllSorted
in interface ObjectDao
s
- the name of the property to be sorted on. This should be null if no sorting is required.cached
- control whether the results should be cachedfirstRow
- the index of the first result to be returnedmaxRows
- the maximum number of results required. Use -1 to specify no limit.@Nonnull public <T> PageResponse<T> findByClassIds(Iterable<Long> ids, LimitedRequest limitedRequest, com.google.common.base.Predicate<? super T> filter)
ObjectDao
findByClassIds
in interface ObjectDao
T
- the type of entity to returnids
- - the ids of the entities to findlimitedRequest
- the pagination request defining the page size to fetchfilter
- a predicate to do in memory filtering of the result set before returningpublic void save(com.atlassian.core.bean.EntityObject objectToSave)
public Class getPersistentClass()
getPersistentClass
in interface ObjectDao
public void saveRaw(com.atlassian.core.bean.EntityObject objectToSave)
ObjectDao
Copyright © 2003–2016 Atlassian. All rights reserved.