Class GamificationHistoryDAO
java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<GamificationActionsHistory,Long>
org.exoplatform.addons.gamification.storage.dao.GamificationHistoryDAO
- All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<GamificationActionsHistory,Long>
public class GamificationHistoryDAO
extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<GamificationActionsHistory,Long>
-
Field Summary
FieldsFields inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
modelClass -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncountAnnouncementsByChallenge(Long challengeId) countAnnouncementsByChallengeAndEarnerType(Long challengeId, IdentityType earnerType) intfindActionHistoryByDateByEarnerId(Date date, String earnerId) Get The last ActionHistory recordfindActionsHistoryByDateByDomain(Date date, IdentityType earnerType, long domainId, int limit) Find actionsHistory by data and domainfindActionsHistoryByEarnerId(String earnerId, int limit) Get an ActionHistory record based on userIdfindActionsHistoryByEarnerIdAndByType(String earnerId, EntityType type) Find all gamification entries by earnerId and by typefindActionsHistoryByEarnerIdSortedByDate(String earnerId, int limit) Find actionsHistory by data and domain and date and pointsfindAllActionsHistory(IdentityType earnerType, int limit) Get all ActionHistory records paginatedfindAllActionsHistoryAgnostic(IdentityType earnerType) Get all ActionHistory records and convert them to list of type StandardLeaderboardfindAllActionsHistoryByDate(Date date, IdentityType earnerType, int limit) Find all gamification entries by datefindAllActionsHistoryByDate(IdentityType earnerType, Date date) Find all gamification entries by datefindAllActionsHistoryByDateByDomain(IdentityType earnerType, Date date, long domainId) Find all gamification entries by domain and by typefindAllActionsHistoryByDomain(long domainId, IdentityType earnerType, int limit) Find all gamification entries by domainfindAllActionsHistoryByDomain(IdentityType earnerType, long domainId) Find all gamification entries by domainfindAllAnnouncementByChallenge(Long challengeId, int offset, int limit, PeriodType periodType, IdentityType earnerType) findAllLeaderboardBetweenDate(IdentityType earnerType, Date fromDate, Date toDate) findDomainScoreByIdentityId(String earnerId) Compute for a given user the score earned for each domanfindMostRealizedRuleIds(List<Long> spacesIds, int offset, int limit, EntityType type) findRealizationsByFilter(RealizationsFilter realizationFilter, int offset, int limit) Find realizations by filter with offset, limit.findStatsByUserId(String earnerId, Date fromDate, Date toDate) Get earner statslongfindUserReputationScoreBetweenDate(String earnerId, Date fromDate, Date toDate) longfindUserReputationScoreByDomainBetweenDate(String earnerId, long domainId, Date fromDate, Date toDate) longfindUserReputationScoreByMonth(String earnerId, Date currentMonth) findUsersReputationScoreBetweenDate(List<String> earnersId, Date fromDate, Date toDate) getAllPointsByDomain(long domainId) longgetTotalScore(String earnerId) Methods inherited from class org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl
count, create, createAll, delete, deleteAll, deleteAll, find, findAll, getEntityManager, getHibernateDialect, isMSSQLDialect, isOrcaleDialect, update, updateAll
-
Field Details
-
STATUS
- See Also:
-
TYPE
- See Also:
-
-
Constructor Details
-
GamificationHistoryDAO
public GamificationHistoryDAO()
-
-
Method Details
-
findAllActionsHistoryAgnostic
Get all ActionHistory records and convert them to list of type StandardLeaderboard- Parameters:
earnerType- :IdentityTypeUSER or SPACE- Returns:
- list of type StandardLeaderboard
-
findAllActionsHistoryByDateByDomain
public List<StandardLeaderboard> findAllActionsHistoryByDateByDomain(IdentityType earnerType, Date date, long domainId) Find all gamification entries by domain and by type- Parameters:
earnerType- :IdentityTypeUSER or SPACEdate- : date from when we load gamification entriesdomainId- : domain Id- Returns:
- list of object of type StandardLeaderboard
-
findActionsHistoryByEarnerIdAndByType
public List<GamificationActionsHistory> findActionsHistoryByEarnerIdAndByType(String earnerId, EntityType type) Find all gamification entries by earnerId and by type- Parameters:
earnerId- : the userId used in projectiontype- : The Type of action- Returns:
- list of objects of type GamificationActionsHistory
-
findAllActionsHistoryByDomain
public List<StandardLeaderboard> findAllActionsHistoryByDomain(IdentityType earnerType, long domainId) Find all gamification entries by domain- Parameters:
earnerType- :IdentityTypeUSER or SPACEdomainId- : domain Id- Returns:
- list of object of type StandardLeaderboard
-
findAllActionsHistoryByDomain
public List<StandardLeaderboard> findAllActionsHistoryByDomain(long domainId, IdentityType earnerType, int limit) Find all gamification entries by domain- Parameters:
domainId- : domain idearnerType- :IdentityTypeUSER or SPACElimit- : limit of the query- Returns:
- list of object of type StandardLeaderboard
-
findAllActionsHistoryByDate
Find all gamification entries by date- Parameters:
date- : date from when entries are loadedearnerType- :IdentityTypeUSER or SPACE- Returns:
- list of object of type StandardLeaderboard
-
findAllActionsHistoryByDate
public List<StandardLeaderboard> findAllActionsHistoryByDate(Date date, IdentityType earnerType, int limit) Find all gamification entries by date- Parameters:
date- : date from when entries are loadedearnerType- :IdentityTypeUSER or SPACElimit- : limit of the query- Returns:
- list of object of type StandardLeaderboard
-
findActionsHistoryByEarnerId
Get an ActionHistory record based on userId- Parameters:
earnerId- : the userId used in projectionlimit- : limit of the query- Returns:
- list of objects of type GamificationActionsHistory
-
findAllActionsHistory
Get all ActionHistory records paginated- Parameters:
earnerType- :IdentityTypeUSER or SPACElimit- : limit of the query- Returns:
- list of object of type StandardLeaderboard
-
findActionHistoryByDateByEarnerId
public List<GamificationActionsHistory> findActionHistoryByDateByEarnerId(Date date, String earnerId) Get The last ActionHistory record- Parameters:
date- : date from when we aim to track the userearnerId- identity id of earner- Returns:
- an instance of type GamificationActionsHistory
-
findActionsHistoryByDateByDomain
public List<StandardLeaderboard> findActionsHistoryByDateByDomain(Date date, IdentityType earnerType, long domainId, int limit) Find actionsHistory by data and domain- Parameters:
date- : date from when we aim to track userearnerType- :IdentityTypeUSER or SPACEdomainId- : domain Id we aim to tracklimit- : how many records we should load from DB- Returns:
- a list of object of type StandardLraderboard
-
findStatsByUserId
Get earner stats -
findDomainScoreByIdentityId
Compute for a given user the score earned for each doman- Parameters:
earnerId- ProfileReputation- Returns:
- a list of objects of type
-
findUserReputationScoreBetweenDate
-
findUsersReputationScoreBetweenDate
-
findUserReputationScoreByMonth
-
findUserReputationScoreByDomainBetweenDate
-
findAllLeaderboardBetweenDate
public List<StandardLeaderboard> findAllLeaderboardBetweenDate(IdentityType earnerType, Date fromDate, Date toDate) -
findActionsHistoryByEarnerIdSortedByDate
public List<GamificationActionsHistory> findActionsHistoryByEarnerIdSortedByDate(String earnerId, int limit) Find actionsHistory by data and domain and date and points- Parameters:
earnerId- : earner identity idlimit- : how many records we should load from DB- Returns:
- a list of object of type GamificationActionsHistory
-
getTotalScore
-
getAllPointsByDomain
-
countAnnouncementsByChallenge
-
countAnnouncementsByChallengeAndEarnerType
-
findAllAnnouncementByChallenge
public List<GamificationActionsHistory> findAllAnnouncementByChallenge(Long challengeId, int offset, int limit, PeriodType periodType, IdentityType earnerType) -
findMostRealizedRuleIds
public List<Long> findMostRealizedRuleIds(List<Long> spacesIds, int offset, int limit, EntityType type) -
findRealizationsByFilter
public List<GamificationActionsHistory> findRealizationsByFilter(RealizationsFilter realizationFilter, int offset, int limit) Find realizations by filter with offset, limit.- Parameters:
realizationFilter- : data Transfert ObjectRealizationsFilteroffset- : the starting index, when supplied. Starts at 0.limit- : how many realizations we should load from DB- Returns:
- a list of object of type GamificationActionsHistory
-
countRealizationsByFilter
-