Added purgeGame(), purgePlayer(), nixed deletePercentiles().

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@853 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Michael Bayne
2009-06-09 20:29:11 +00:00
parent 2496ec5701
commit a8b5a3feb3
@@ -195,14 +195,6 @@ public class RatingRepository extends DepotRepository
store(record);
}
/**
* Deletes all percentile records for the specified game.
*/
public void deletePercentiles (int gameId)
{
deleteAll(PercentileRecord.class, new Where(PercentileRecord.GAME_ID, gameId));
}
/**
* Deletes the percentile record for the specified game and game mode.
*/
@@ -211,6 +203,23 @@ public class RatingRepository extends DepotRepository
delete(PercentileRecord.getKey(gameId, gameMode));
}
/**
* Deletes all rating and percentile records for the specified game.
*/
public void purgeGame (int gameId)
{
deleteAll(RatingRecord.class, new Where(RatingRecord.GAME_ID, gameId), null);
deleteAll(PercentileRecord.class, new Where(PercentileRecord.GAME_ID, gameId), null);
}
/**
* Deletes all rating records for the specified player.
*/
public void purgePlayer (int playerId)
{
deleteAll(RatingRecord.class, new Where(RatingRecord.PLAYER_ID, playerId), null);
}
@Override
protected void getManagedRecords (Set<Class<? extends PersistentRecord>> classes)
{