diff --git a/src/main/java/com/threerings/user/depot/RewardRepository.java b/src/main/java/com/threerings/user/depot/RewardRepository.java index 73d8144..c487fa7 100644 --- a/src/main/java/com/threerings/user/depot/RewardRepository.java +++ b/src/main/java/com/threerings/user/depot/RewardRepository.java @@ -1,5 +1,5 @@ // -// $Id$ +// $Id: RewardRepository.java 3547 2011-03-03 04:40:51Z jamie $ package com.threerings.user.depot; @@ -52,6 +52,12 @@ public class RewardRepository extends DepotRepository super(new PersistenceContext(OOOUserRepository.USER_REPOSITORY_IDENT, provider, null)); } + @Override // TEMP: just make it public + public void registerMigration (com.samskivert.depot.DataMigration mig) + { + super.registerMigration(mig); + } + /** * Creates a new RewardInfo record in the database. info should have the * description, data and expiration filled in. @@ -196,6 +202,16 @@ public class RewardRepository extends DepotRepository return findAll(RewardInfoRecord.class, OrderBy.descending(RewardInfoRecord.REWARD_ID)); } + /** + * Return just the ids of all activated rewards for the specified account. + */ + public List loadActivatedRewardIds (String account) + { + return from(RewardRecord.class) + .where(RewardRecord.ACCOUNT.eq(account)) + .select(RewardRecord.REWARD_ID); + } + /** * Returns all RewardRecords that match the given account name and whose eligible * date is in the past. The returned list will be sorted by rewardId. @@ -207,6 +223,16 @@ public class RewardRepository extends DepotRepository OrderBy.ascending(RewardRecord.REWARD_ID)); } + /** + * Load the redeemable reward records. + */ + public List loadRedeemableRewards (String account) + { + return from(RewardRecord.class) + .where(RewardRecord.ACCOUNT.eq(account), RewardRecord.REDEEMER_IDENT.isNull()) + .select(); + } + /** * Returns all RewardRecords that match either the account or redeemer identifier. * The returned list will be sorted by rewardId.