From c826583754b646b2d21a55039b8462ab8a8ad8eb Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Wed, 25 Jul 2007 21:07:35 +0000 Subject: [PATCH] More Depot NWO. git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@377 c613c5cb-e716-0410-b11b-feb51c14d237 --- .../server/persist/RatingRepository.java | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java b/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java index 7192108a..7e6b0e5e 100644 --- a/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java +++ b/src/java/com/threerings/parlor/rating/server/persist/RatingRepository.java @@ -29,8 +29,8 @@ import com.samskivert.io.PersistenceException; import com.samskivert.jdbc.ConnectionProvider; import com.samskivert.jdbc.depot.DepotRepository; import com.samskivert.jdbc.depot.clause.Where; -import com.samskivert.jdbc.depot.operator.Logic.*; import com.samskivert.jdbc.depot.operator.Conditionals.*; +import com.samskivert.jdbc.depot.operator.Logic.And; /** * Handles the persistent storage of per-user per-game ratings. @@ -52,10 +52,9 @@ public class RatingRepository extends DepotRepository public RatingRecord getRating (int gameId, int playerId) throws PersistenceException { - return load( - RatingRecord.class, - RatingRecord.GAME_ID, gameId, - RatingRecord.PLAYER_ID, playerId); + return load(RatingRecord.class, + RatingRecord.GAME_ID, gameId, + RatingRecord.PLAYER_ID, playerId); } /** @@ -69,11 +68,9 @@ public class RatingRepository extends DepotRepository if (players.length == 0) { return Collections.emptyList(); } - return findAll( - RatingRecord.class, - new Where(new And( - new Equals(RatingRecord.GAME_ID, gameId), - new In(RatingRecord.PLAYER_ID, players)))); + return findAll(RatingRecord.class, + new Where(new And(new Equals(RatingRecord.GAME_ID_C, gameId), + new In(RatingRecord.PLAYER_ID_C, players)))); } /** @@ -82,7 +79,7 @@ public class RatingRepository extends DepotRepository public List getRatings (int playerId) throws PersistenceException { - return findAll(RatingRecord.class, new Where(RatingRecord.PLAYER_ID, playerId)); + return findAll(RatingRecord.class, new Where(RatingRecord.PLAYER_ID_C, playerId)); } /**