com.threerings.stats.server.persist
Class StatRecord

java.lang.Object
  extended by com.samskivert.depot.impl.QueryResult
      extended by com.samskivert.depot.PersistentRecord
          extended by com.threerings.stats.server.persist.StatRecord
All Implemented Interfaces:
Serializable, Cloneable

public class StatRecord
extends com.samskivert.depot.PersistentRecord

See Also:
Serialized Form

Field Summary
static Class<StatRecord> _R
           
static com.samskivert.depot.expression.ColumnExp<Byte> MOD_COUNT
           
 byte modCount
          The number of times this stat has been updated, so that simultaneous attempts to update the same stat in the repository can be caught and handled.
static com.samskivert.depot.expression.ColumnExp<Integer> PLAYER_ID
           
 int playerId
          The identifier of the player this is a stat for.
static int SCHEMA_VERSION
           
static com.samskivert.depot.expression.ColumnExp<Integer> STAT_CODE
           
static com.samskivert.depot.expression.ColumnExp<byte[]> STAT_DATA
           
 int statCode
          The code of the stat.
 byte[] statData
          The data associated with the stat.
 
Constructor Summary
StatRecord()
          An empty constructor for unmarshalling.
StatRecord(int playerId, int statCode, byte[] data)
          A constructor that populates all our fields.
StatRecord(int playerId, int statCode, byte[] data, byte modCount)
           
 
Method Summary
static com.samskivert.depot.Key<StatRecord> getKey(int playerId, int statCode)
          Create and return a primary Key to identify a StatRecord with the supplied key values.
 String toString()
           
 
Methods inherited from class com.samskivert.depot.PersistentRecord
colexp, newKey, registerKeyFields
 
Methods inherited from class com.samskivert.depot.impl.QueryResult
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

_R

public static final Class<StatRecord> _R

PLAYER_ID

public static final com.samskivert.depot.expression.ColumnExp<Integer> PLAYER_ID

STAT_CODE

public static final com.samskivert.depot.expression.ColumnExp<Integer> STAT_CODE

STAT_DATA

public static final com.samskivert.depot.expression.ColumnExp<byte[]> STAT_DATA

MOD_COUNT

public static final com.samskivert.depot.expression.ColumnExp<Byte> MOD_COUNT

SCHEMA_VERSION

public static final int SCHEMA_VERSION
See Also:
Constant Field Values

playerId

public int playerId
The identifier of the player this is a stat for.


statCode

public int statCode
The code of the stat.


statData

public byte[] statData
The data associated with the stat.


modCount

public byte modCount
The number of times this stat has been updated, so that simultaneous attempts to update the same stat in the repository can be caught and handled. Stored as a byte because we don't expect to ever have more than a couple simultaneous attempts to update a stat.

Constructor Detail

StatRecord

public StatRecord()
An empty constructor for unmarshalling.


StatRecord

public StatRecord(int playerId,
                  int statCode,
                  byte[] data)
A constructor that populates all our fields.


StatRecord

public StatRecord(int playerId,
                  int statCode,
                  byte[] data,
                  byte modCount)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

getKey

public static com.samskivert.depot.Key<StatRecord> getKey(int playerId,
                                                          int statCode)
Create and return a primary Key to identify a StatRecord with the supplied key values.