Add an index, document index use for Depot operations. Do you think this is worthwhile? We should really just about never see a non-indexed query during normal production use and one way to maintain that discipline is with a comment line like this.

git-svn-id: svn+ssh://src.earth.threerings.net/vilya/trunk@399 c613c5cb-e716-0410-b11b-feb51c14d237
This commit is contained in:
Par Winzell
2007-08-07 18:05:44 +00:00
parent 96b42efbae
commit e386d6c3a0
5 changed files with 27 additions and 12 deletions
@@ -45,6 +45,7 @@ public class GameCookieRepository extends DepotRepository
public byte[] getCookie (int gameId, int userId)
throws PersistenceException
{
// INDEX: Primary key.
GameCookieRecord record = load(
GameCookieRecord.class, GameCookieRecord.getKey(gameId, userId));
return record != null ? record.cookie : null;
@@ -58,8 +59,10 @@ public class GameCookieRepository extends DepotRepository
throws PersistenceException
{
if (cookie != null) {
// INDEX: Primary key.
store(new GameCookieRecord(gameId, userId, cookie));
} else {
// INDEX: Primary key.
delete(GameCookieRecord.class, GameCookieRecord.getKey(gameId, userId));
}
}