game.gamestorage.texas.db.estimation
Class GetterQuery

java.lang.Object
  extended by game.gamestorage.texas.db.estimation.GetterQuery

public final class GetterQuery
extends java.lang.Object

This class holds the sql-queries for reading the db

Author:
Witthold/Korol

Constructor Summary
GetterQuery()
           
 
Method Summary
protected static java.lang.String getCompetitionIds(int gamedef_id)
           
protected static java.lang.String getCompetitionIds(int gamedef_id, long timestamp)
           
protected static java.lang.String getCompetitionIds(long timestamp)
           
protected static java.lang.String getCompetitionPlayerMaps(int competition_id)
           
protected static java.lang.String getFirstBetOfRound(int player_id, int hand_id)
           
protected static java.lang.String getFirstBetsOfRound(int player_id, int competition_id, int lastEvaledHandId)
           
protected static java.lang.String getFirstRounds(int player_id, int competition_id, int lastEvaledHandId)
           
protected static java.lang.String getHandPlayerMapCardsClosed(int player_id, int competition_id, int lastEvaledHandId)
           
protected static java.lang.String getHandPlayerMapWhereEnemyCardsOpenAllTime(int player_id)
           
protected static java.lang.String getHandPlayerMapWhereEnemyCardsOpenPerComp(int player_id, int competition_id, int lastEvaledHandId)
           
protected static java.lang.String getHandsCC(int player_id, int competition_id, int lastEvaledHandId)
           
protected static java.lang.String getHandsCO(int player_id, int competition_id, int lastEvaledHandId)
           
protected static java.lang.String getHoleCards(int hand_player_map_id)
           
protected static java.lang.String getLatestCompetitionId()
           
protected static java.lang.String getLatestHandId()
           
protected static java.lang.String getNumActivePlayers(int hand_id)
           
protected static java.lang.String getPlayersInCompetition(int competition_id)
           
protected static java.lang.String getPlayersInCompetitionSI(int competition_id)
           
protected static java.lang.String getPreviousActions(long round_id, long playersFirstBetId)
           
protected static java.lang.String getPreviousActionsMulti(long round_id, long playersFirstBetId)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetterQuery

public GetterQuery()
Method Detail

getCompetitionIds

protected static java.lang.String getCompetitionIds(long timestamp)
Parameters:
timestamp - as unix timestamp
Returns:
int[] of competition_ids newer than timestamp && same gamedef like newest

getCompetitionIds

protected static java.lang.String getCompetitionIds(int gamedef_id)
Parameters:
gamedef_id - - already generated by db
Returns:
int[] of competition_ids newer than timestamp && same gamedef like newest

getCompetitionIds

protected static java.lang.String getCompetitionIds(int gamedef_id,
                                                    long timestamp)
Parameters:
gamedef_id - - already generated by db
timestamp - as unix timestamp
Returns:
int[] of competition_ids newer than timestamp && same gamedef like newest

getLatestCompetitionId

protected static java.lang.String getLatestCompetitionId()
Returns:
MAX(id)

getLatestHandId

protected static java.lang.String getLatestHandId()
Returns:
MAX(id)

getCompetitionPlayerMaps

protected static java.lang.String getCompetitionPlayerMaps(int competition_id)
Parameters:
competition_id - already generated by db
Returns:
player_id, cash_init, rank

getPlayersInCompetition

protected static java.lang.String getPlayersInCompetition(int competition_id)
Parameters:
competition_id - already generated by db
Returns:
player.id, player.alias

getPlayersInCompetitionSI

protected static java.lang.String getPlayersInCompetitionSI(int competition_id)
Parameters:
competition_id - already generated by db
Returns:
player.alias, player.id

getHandPlayerMapWhereEnemyCardsOpenAllTime

protected static java.lang.String getHandPlayerMapWhereEnemyCardsOpenAllTime(int player_id)
Parameters:
player_id - already generated by db
Returns:
hand_player_map for EnemyCardsOpen with:
hand_player_map.id, hand_player_map.position, hand_player_map.cash_init, hand_player_map.cash_delta, hand_player_map.hand_id

getHandPlayerMapWhereEnemyCardsOpenPerComp

protected static java.lang.String getHandPlayerMapWhereEnemyCardsOpenPerComp(int player_id,
                                                                             int competition_id,
                                                                             int lastEvaledHandId)
Parameters:
player_id - already generated by db
competition_id - already generated by db
lastEvaledHandId - already generated by db
Returns:
hand_player_map for EnemyCardsOpen with:
hand_player_map.id, hand_player_map.position, hand_player_map.cash_init, hand_player_map.cash_delta, hand_player_map.hand_id

getNumActivePlayers

protected static java.lang.String getNumActivePlayers(int hand_id)
Parameters:
hand_id - already generated by db
Returns:
NumActivePlayers at hand

getHoleCards

protected static java.lang.String getHoleCards(int hand_player_map_id)
Parameters:
hand_player_map_id - already generated by db
Returns:
int[] EnemyCards

getFirstBetOfRound

protected static java.lang.String getFirstBetOfRound(int player_id,
                                                     int hand_id)
Parameters:
player_id - already generated by db
hand_id - already generated by db
Returns:
long[] BetOfFirstAction with:
action, betsize, potsize, timestamp, round_id

getPreviousActions

protected static java.lang.String getPreviousActions(long round_id,
                                                     long playersFirstBetId)
Parameters:
round_id - already generated by db
playersFirstBetId - already generated by db
Returns:
long[] PreviousActions with:
action

getPreviousActionsMulti

protected static java.lang.String getPreviousActionsMulti(long round_id,
                                                          long playersFirstBetId)
Parameters:
round_id - already generated by db
playersFirstBetId - already generated by db
Returns:
long[] PreviousActions with:
action

getHandsCO

protected static java.lang.String getHandsCO(int player_id,
                                             int competition_id,
                                             int lastEvaledHandId)
Parameters:
player_id - already generated by db
competition_id - already generated by db
lastEvaledHandId - already generated by db
Returns:
ArrayList of int[] Hands with:
hand.id, hand.sb, hand.bb, hand.ante, hand.finalpot

getHandPlayerMapCardsClosed

protected static java.lang.String getHandPlayerMapCardsClosed(int player_id,
                                                              int competition_id,
                                                              int lastEvaledHandId)
Parameters:
player_id - already generated by db
competition_id - already generated by db
lastEvaledHandId - already generated by db
Returns:
ArrayList of int[] Hands with:
hand_player_map for EnemyCardsOpen with:
hand_player_map.id, hand_player_map.position, hand_player_map.cash_init, hand_player_map.cash_delta, hand_player_map.hand_id

getHandsCC

protected static java.lang.String getHandsCC(int player_id,
                                             int competition_id,
                                             int lastEvaledHandId)
Parameters:
player_id - already generated by db
competition_id - already generated by db
lastEvaledHandId - already generated by db
Returns:
ArrayList of int[] Hands with:
hand.id, hand.sb, hand.bb, hand.ante, hand.finalpot

getFirstBetsOfRound

protected static java.lang.String getFirstBetsOfRound(int player_id,
                                                      int competition_id,
                                                      int lastEvaledHandId)
Parameters:
player_id - already generated by db
competition_id - already generated by db
lastEvaledHandId - already generated by db
Returns:
ArrayList of long[] firstBetOfRound with:
bet.round_id, MIN(bet.id), bet.action, bet.betsize, bet.potsize, bet.timestamp, bet.round_id

getFirstRounds

protected static java.lang.String getFirstRounds(int player_id,
                                                 int competition_id,
                                                 int lastEvaledHandId)
Parameters:
player_id - already generated by db
competition_id - already generated by db
lastEvaledHandId - already generated by db
Returns:
ArrayList of long[] rounds with:
round.hand_id, round.id, round.timestamp