Class RealizationDAO

java.lang.Object
org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<RealizationEntity,Long>
io.meeds.gamification.dao.RealizationDAO
All Implemented Interfaces:
org.exoplatform.commons.api.persistence.GenericDAO<RealizationEntity,Long>

public class RealizationDAO extends org.exoplatform.commons.persistence.impl.GenericDAOJPAImpl<RealizationEntity,Long>
  • Field Details

  • Constructor Details

    • RealizationDAO

      public RealizationDAO()
  • Method Details

    • getLeaderboardRank

      public int getLeaderboardRank(IdentityType earnerType, String earnerIdentityId)
    • getLeaderboardRankByDatesAndProgramIds

      public int getLeaderboardRankByDatesAndProgramIds(IdentityType earnerType, String earnerIdentityId, Date fromDate, Date toDate, Long... programIds)
    • getLeaderboardRankByProgramIds

      public int getLeaderboardRankByProgramIds(IdentityType earnerType, String earnerIdentityId, Long... programIds)
    • getLeaderboardRankByDates

      public int getLeaderboardRankByDates(IdentityType earnerType, String earnerIdentityId, Date fromDate, Date toDate)
    • getLeaderboard

      public List<StandardLeaderboard> getLeaderboard(IdentityType earnerType, int offset, int limit)
    • getLeaderboardByProgramIds

      public List<StandardLeaderboard> getLeaderboardByProgramIds(IdentityType earnerType, int offset, int limit, Long... programIds)
    • getLeaderboardByDates

      public List<StandardLeaderboard> getLeaderboardByDates(Date fromDate, Date toDate, IdentityType earnerType, int offset, int limit)
    • getLeaderboardByDatesAndProgramIds

      public List<StandardLeaderboard> getLeaderboardByDatesAndProgramIds(Date fromDate, Date toDate, IdentityType earnerType, int offset, int limit, Long... programIds)
    • getScoreByIdentityId

      public long getScoreByIdentityId(String earnerIdentityId)
    • getLeaderboardStatsByIdentityIdAndDates

      public List<PiechartLeaderboard> getLeaderboardStatsByIdentityIdAndDates(String earnerId, Long spaceId, Date fromDate, Date toDate)
    • getLeaderboardStatsByIdentityId

      public List<PiechartLeaderboard> getLeaderboardStatsByIdentityId(String earnerId, Long spaceId)
    • getScorePerProgramByIdentityId

      public List<ProfileReputation> getScorePerProgramByIdentityId(String earnerId)
      Compute for a given user the score earned for each doman
      Parameters:
      earnerId - ProfileReputation
      Returns:
      a list of objects of type
    • getScoreByIdentityIdAndBetweenDates

      public long getScoreByIdentityIdAndBetweenDates(String earnerId, Date fromDate, Date toDate, Long... programIds)
    • getScoreByIdentityIdsAndBetweenDates

      public Map<Long,Long> getScoreByIdentityIdsAndBetweenDates(List<String> earnersId, Date fromDate, Date toDate)
    • countRealizationsByRuleIdAndEarnerId

      public int countRealizationsByRuleIdAndEarnerId(String earnerIdentityId, long ruleId)
    • getParticipantsBetweenDates

      public List<Long> getParticipantsBetweenDates(Date fromDate, Date toDate)
    • countParticipantsBetweenDates

      public long countParticipantsBetweenDates(Date fromDate, Date toDate)
    • countRealizationsInPeriod

      public int countRealizationsInPeriod(String earnerIdentityId, long ruleId, Date sinceDate)
    • findLastRealizationByRuleIdAndEarnerIdAndReceiverAndObjectId

      public Long findLastRealizationByRuleIdAndEarnerIdAndReceiverAndObjectId(long ruleId, String earnerId, String receiverId, String objectId, String objectType)
    • getRealizationsByObjectIdAndObjectType

      public List<Long> getRealizationsByObjectIdAndObjectType(String objectId, String objectType)
    • findRealizationsByFilter

      public List<Long> findRealizationsByFilter(RealizationFilter realizationFilter, int offset, int limit)
      Find realizations by filter with offset, limit.
      Parameters:
      realizationFilter - : data Transfert Object RealizationFilter
      offset - : the starting index, when supplied. Starts at 0.
      limit - : how many realizations we should load from DB
      Returns:
      a list of object of type RealizationEntity
    • countRealizationsByFilter

      public int countRealizationsByFilter(RealizationFilter filter)