public class WPBDatabase extends Object
Modifier and Type | Field and Description |
---|---|
static int |
ACCOUNT_OPERATION_DEPOSIT |
static int |
ACCOUNT_OPERATION_PAYMENT |
static int |
ACCOUNT_OPERATION_WITHDRAWAL |
Constructor and Description |
---|
WPBDatabase(Map<String,String> dbProps) |
public static final int ACCOUNT_OPERATION_DEPOSIT
public static final int ACCOUNT_OPERATION_WITHDRAWAL
public static final int ACCOUNT_OPERATION_PAYMENT
public User getUser(int id) throws SQLException
SQLException
public User getUserByConfirmCode(String code) throws SQLException
SQLException
public User getUser(String userName) throws SQLException
SQLException
public User getUserbyEmail(String email) throws SQLException
SQLException
public User createUser(User user) throws SQLException
SQLException
public DepositWithdrawal createDepositOrWithdrawal(int user_id, DepositWithdrawal.OperationType type, long amount) throws SQLException
SQLException
public Transaction createTransaction(int source_user_id, int destination_user_id, long amount) throws SQLException
SQLException
public void updateUser(User user) throws SQLException
SQLException
public Account getAccount(int user_id) throws SQLException
SQLException
public DepositWithdrawal getDepositOrWithdrawal(long id) throws SQLException
SQLException
public Transaction getTransaction(long id) throws SQLException
SQLException
public Map<Date,Integer> getUsersCountFromLastDays(int days) throws SQLException
SQLException
public Map<Date,Integer> getSumOperationsFromLastDays(int type, int days) throws SQLException
SQLException
public Map<Date,Integer> getCountOperationsFromLastDays(int type, int days) throws SQLException
SQLException
public List<Transaction> getTransactionsForUser(int user_id, Date date, int page, int pageSize) throws SQLException
SQLException
public List<DepositWithdrawal> getDepositsWithdrawalsForUser(int user_id, DepositWithdrawal.OperationType type, Date date, int page, int pageSize) throws SQLException
SQLException
public List<AccountOperation> getAccountOperationsForUser(int user_id, Date date, int count) throws SQLException
SQLException
public Session createSession(String sessionId) throws SQLException
SQLException
public Session getSession(String session_id) throws SQLException
SQLException
public void setSession(Session session) throws SQLException
SQLException
Copyright © 2016. All rights reserved.