Log changes in players' coins to database

This commit is contained in:
CoderTim 2014-09-25 17:03:26 -04:00
parent 969c7c0fde
commit ba2f0e37ef
12 changed files with 568 additions and 15 deletions

View File

@ -0,0 +1,9 @@
<component name="libraryTable">
<library name="commons-dbcp2">
<CLASSES>
<root url="jar://$PROJECT_DIR$/Libraries/commons-dbcp2-2.0.1.jar!/" />
</CLASSES>
<JAVADOC />
<SOURCES />
</library>
</component>

Binary file not shown.

View File

@ -17,6 +17,7 @@
<orderEntry type="library" name="craftbukkit" level="project" />
<orderEntry type="module" module-name="Mineplex.Database" />
<orderEntry type="library" name="jooq" level="project" />
<orderEntry type="library" name="commons-dbcp2" level="project" />
</component>
</module>

View File

@ -0,0 +1,51 @@
package mineplex.core.database;
import java.sql.Connection;
import java.sql.SQLException;
import org.apache.commons.dbcp2.BasicDataSource;
public class DBPool
{
private static final DBPool _instance = new DBPool();
public static DBPool getInstance()
{
return _instance;
}
private BasicDataSource _source = null;
public synchronized BasicDataSource source()
{
if (_source == null || _source.isClosed())
{
_source = new BasicDataSource();
_source.addConnectionProperty("autoReconnect", "true");
_source.setDefaultAutoCommit(true);
_source.setEnableAutoCommitOnReturn(true);
_source.setDefaultTransactionIsolation(Connection.TRANSACTION_REPEATABLE_READ);
_source.setDriverClassName("com.mysql.jdbc.Driver");
_source.setUrl("jdbc:mysql://db.mineplex.com/Account");
_source.setUsername("root");
_source.setPassword("tAbechAk3wR7tuTh");
}
return _source;
}
public synchronized Connection getConnection() throws SQLException
{
return source().getConnection();
}
public synchronized void close() throws SQLException
{
if (_source != null)
{
_source.close();
_source = null;
}
}
}

View File

@ -1,17 +1,25 @@
package mineplex.core.donation;
import java.sql.Connection;
import java.sql.SQLException;
import mineplex.core.MiniPlugin;
import mineplex.core.account.event.ClientUnloadEvent;
import mineplex.core.account.event.ClientWebResponseEvent;
import mineplex.core.common.CurrencyType;
import mineplex.core.common.util.Callback;
import mineplex.core.common.util.NautHashMap;
import mineplex.core.database.DBPool;
import mineplex.core.donation.repository.DonationRepository;
import mineplex.core.donation.repository.token.DonorTokenWrapper;
import mineplex.core.server.util.TransactionResponse;
import mineplex.core.updater.UpdateType;
import mineplex.core.updater.event.UpdateEvent;
import mineplex.database.Tables;
import org.jooq.DSLContext;
import org.jooq.impl.DSL;
import org.bukkit.Bukkit;
import org.bukkit.craftbukkit.libs.com.google.gson.Gson;
import org.bukkit.event.EventHandler;
import org.bukkit.plugin.java.JavaPlugin;
@ -100,6 +108,9 @@ public class DonationManager extends MiniPlugin
{
donor.AddUnknownSalesPackagesOwned(packageName);
donor.DeductCost(cost, coinPurchase ? CurrencyType.Coins : CurrencyType.Gems);
if (coinPurchase)
logCurrencyChange(name, CurrencyType.Coins, -cost, donor.getCoins());
}
}
@ -233,6 +244,8 @@ public class DonationManager extends MiniPlugin
if (donor != null)
{
donor.addCoins(amount);
logCurrencyChange(name, CurrencyType.Coins, amount, donor.getCoins());
}
}
@ -242,4 +255,30 @@ public class DonationManager extends MiniPlugin
}
}, caller, name, amount);
}
public void logCurrencyChange(final String playerName, final CurrencyType currencyType, final int change, final int newTotal)
{
Bukkit.getScheduler().runTaskAsynchronously(_plugin, new Runnable()
{
@Override
public void run()
{
try (Connection connection = DBPool.getInstance().getConnection())
{
DSLContext context = DSL.using(connection);
context.insertInto(Tables.currencyTransactionLog)
.set(Tables.currencyTransactionLog.accountId, DSL.select(Tables.accounts.id).from(Tables.accounts).where(Tables.accounts.name.eq(playerName)))
.set(Tables.currencyTransactionLog.currencyType, currencyType.ordinal())
.set(Tables.currencyTransactionLog.change, change)
.set(Tables.currencyTransactionLog.total, newTotal)
.execute();
}
catch (SQLException e)
{
e.printStackTrace();
}
}
});
}
}

View File

@ -11,7 +11,7 @@ package mineplex.database;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Account extends org.jooq.impl.SchemaImpl implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 1511797714;
private static final long serialVersionUID = -1621358205;
/**
* The singleton instance of <code>Account</code>
@ -40,6 +40,7 @@ public class Account extends org.jooq.impl.SchemaImpl implements java.io.Seriali
mineplex.database.tables.AccountPreferences.accountPreferences,
mineplex.database.tables.Accounts.accounts,
mineplex.database.tables.AccountStats.accountStats,
mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog,
mineplex.database.tables.GamePlayers.gamePlayers,
mineplex.database.tables.Games.games,
mineplex.database.tables.ItemCategories.itemCategories,

View File

@ -24,6 +24,7 @@ public class Keys {
public static final org.jooq.Identity<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Integer> IDENTITY_accountPreferences = Identities0.IDENTITY_accountPreferences;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> IDENTITY_accounts = Identities0.IDENTITY_accounts;
public static final org.jooq.Identity<mineplex.database.tables.records.AccountStatsRecord, java.lang.Integer> IDENTITY_accountStats = Identities0.IDENTITY_accountStats;
public static final org.jooq.Identity<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> IDENTITY_currencyTransactionLog = Identities0.IDENTITY_currencyTransactionLog;
public static final org.jooq.Identity<mineplex.database.tables.records.GamePlayersRecord, java.lang.Integer> IDENTITY_gamePlayers = Identities0.IDENTITY_gamePlayers;
public static final org.jooq.Identity<mineplex.database.tables.records.GamesRecord, java.lang.Integer> IDENTITY_games = Identities0.IDENTITY_games;
public static final org.jooq.Identity<mineplex.database.tables.records.ItemCategoriesRecord, java.lang.Integer> IDENTITY_itemCategories = Identities0.IDENTITY_itemCategories;
@ -51,6 +52,7 @@ public class Keys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountsRecord> KEY_accounts_uuidIndex = UniqueKeys0.KEY_accounts_uuidIndex;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> KEY_accountStats_PRIMARY = UniqueKeys0.KEY_accountStats_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> KEY_accountStats_accountStatIndex = UniqueKeys0.KEY_accountStats_accountStatIndex;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord> KEY_currencyTransactionLog_PRIMARY = UniqueKeys0.KEY_currencyTransactionLog_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamePlayersRecord> KEY_gamePlayers_PRIMARY = UniqueKeys0.KEY_gamePlayers_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamesRecord> KEY_games_PRIMARY = UniqueKeys0.KEY_games_PRIMARY;
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemCategoriesRecord> KEY_itemCategories_PRIMARY = UniqueKeys0.KEY_itemCategories_PRIMARY;
@ -78,6 +80,7 @@ public class Keys {
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountPollsRecord, mineplex.database.tables.records.PollsRecord> accountPolls_ibfk_2 = ForeignKeys0.accountPolls_ibfk_2;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.AccountsRecord> accountStats_ibfk_1 = ForeignKeys0.accountStats_ibfk_1;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.StatsRecord> accountStats_ibfk_2 = ForeignKeys0.accountStats_ibfk_2;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.CurrencyTransactionLogRecord, mineplex.database.tables.records.AccountsRecord> FK_currencyTransactionLog_accounts = ForeignKeys0.FK_currencyTransactionLog_accounts;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.GamesRecord> FK_gamePlayers_games = ForeignKeys0.FK_gamePlayers_games;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.AccountsRecord> FK_gamePlayers_accounts = ForeignKeys0.FK_gamePlayers_accounts;
public static final org.jooq.ForeignKey<mineplex.database.tables.records.ItemsRecord, mineplex.database.tables.records.ItemCategoriesRecord> items_ibfk_1 = ForeignKeys0.items_ibfk_1;
@ -95,6 +98,7 @@ public class Keys {
public static org.jooq.Identity<mineplex.database.tables.records.AccountPreferencesRecord, java.lang.Integer> IDENTITY_accountPreferences = createIdentity(mineplex.database.tables.AccountPreferences.accountPreferences, mineplex.database.tables.AccountPreferences.accountPreferences.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountsRecord, java.lang.Integer> IDENTITY_accounts = createIdentity(mineplex.database.tables.Accounts.accounts, mineplex.database.tables.Accounts.accounts.id);
public static org.jooq.Identity<mineplex.database.tables.records.AccountStatsRecord, java.lang.Integer> IDENTITY_accountStats = createIdentity(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.id);
public static org.jooq.Identity<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> IDENTITY_currencyTransactionLog = createIdentity(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.id);
public static org.jooq.Identity<mineplex.database.tables.records.GamePlayersRecord, java.lang.Integer> IDENTITY_gamePlayers = createIdentity(mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.id);
public static org.jooq.Identity<mineplex.database.tables.records.GamesRecord, java.lang.Integer> IDENTITY_games = createIdentity(mineplex.database.tables.Games.games, mineplex.database.tables.Games.games.id);
public static org.jooq.Identity<mineplex.database.tables.records.ItemCategoriesRecord, java.lang.Integer> IDENTITY_itemCategories = createIdentity(mineplex.database.tables.ItemCategories.itemCategories, mineplex.database.tables.ItemCategories.itemCategories.id);
@ -120,6 +124,7 @@ public class Keys {
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountsRecord> KEY_accounts_uuidIndex = createUniqueKey(mineplex.database.tables.Accounts.accounts, mineplex.database.tables.Accounts.accounts.uuid);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> KEY_accountStats_PRIMARY = createUniqueKey(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.AccountStatsRecord> KEY_accountStats_accountStatIndex = createUniqueKey(mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.accountId, mineplex.database.tables.AccountStats.accountStats.statId);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord> KEY_currencyTransactionLog_PRIMARY = createUniqueKey(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamePlayersRecord> KEY_gamePlayers_PRIMARY = createUniqueKey(mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.GamesRecord> KEY_games_PRIMARY = createUniqueKey(mineplex.database.tables.Games.games, mineplex.database.tables.Games.games.id);
public static final org.jooq.UniqueKey<mineplex.database.tables.records.ItemCategoriesRecord> KEY_itemCategories_PRIMARY = createUniqueKey(mineplex.database.tables.ItemCategories.itemCategories, mineplex.database.tables.ItemCategories.itemCategories.id);
@ -145,6 +150,7 @@ public class Keys {
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountPollsRecord, mineplex.database.tables.records.PollsRecord> accountPolls_ibfk_2 = createForeignKey(mineplex.database.Keys.KEY_polls_PRIMARY, mineplex.database.tables.AccountPolls.accountPolls, mineplex.database.tables.AccountPolls.accountPolls.pollId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.AccountsRecord> accountStats_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.accountId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.AccountStatsRecord, mineplex.database.tables.records.StatsRecord> accountStats_ibfk_2 = createForeignKey(mineplex.database.Keys.KEY_stats_PRIMARY, mineplex.database.tables.AccountStats.accountStats, mineplex.database.tables.AccountStats.accountStats.statId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.CurrencyTransactionLogRecord, mineplex.database.tables.records.AccountsRecord> FK_currencyTransactionLog_accounts = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.accountId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.GamesRecord> FK_gamePlayers_games = createForeignKey(mineplex.database.Keys.KEY_games_PRIMARY, mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.gameId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.GamePlayersRecord, mineplex.database.tables.records.AccountsRecord> FK_gamePlayers_accounts = createForeignKey(mineplex.database.Keys.KEY_accounts_PRIMARY, mineplex.database.tables.GamePlayers.gamePlayers, mineplex.database.tables.GamePlayers.gamePlayers.accountId);
public static final org.jooq.ForeignKey<mineplex.database.tables.records.ItemsRecord, mineplex.database.tables.records.ItemCategoriesRecord> items_ibfk_1 = createForeignKey(mineplex.database.Keys.KEY_itemCategories_PRIMARY, mineplex.database.tables.Items.items, mineplex.database.tables.Items.items.categoryId);

View File

@ -43,6 +43,11 @@ public class Tables {
*/
public static final mineplex.database.tables.AccountStats accountStats = mineplex.database.tables.AccountStats.accountStats;
/**
* The table Account.currencyTransactionLog
*/
public static final mineplex.database.tables.CurrencyTransactionLog currencyTransactionLog = mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog;
/**
* The table Account.gamePlayers
*/

View File

@ -11,7 +11,7 @@ package mineplex.database.tables;
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class Accounts extends org.jooq.impl.TableImpl<mineplex.database.tables.records.AccountsRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = -2025748114;
private static final long serialVersionUID = -3288904;
/**
* The singleton instance of <code>Account.accounts</code>
@ -64,7 +64,7 @@ public class Accounts extends org.jooq.impl.TableImpl<mineplex.database.tables.r
/**
* The column <code>Account.accounts.lastLogin</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.lang.String> lastLogin = createField("lastLogin", org.jooq.impl.SQLDataType.CLOB.length(16777215), this, "");
public final org.jooq.TableField<mineplex.database.tables.records.AccountsRecord, java.sql.Timestamp> lastLogin = createField("lastLogin", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
/**
* The column <code>Account.accounts.totalPlayTime</code>.

View File

@ -0,0 +1,127 @@
/**
* This class is generated by jOOQ
*/
package mineplex.database.tables;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CurrencyTransactionLog extends org.jooq.impl.TableImpl<mineplex.database.tables.records.CurrencyTransactionLogRecord> implements java.io.Serializable, java.lang.Cloneable {
private static final long serialVersionUID = 1764100855;
/**
* The singleton instance of <code>Account.currencyTransactionLog</code>
*/
public static final mineplex.database.tables.CurrencyTransactionLog currencyTransactionLog = new mineplex.database.tables.CurrencyTransactionLog();
/**
* The class holding records for this type
*/
@Override
public java.lang.Class<mineplex.database.tables.records.CurrencyTransactionLogRecord> getRecordType() {
return mineplex.database.tables.records.CurrencyTransactionLogRecord.class;
}
/**
* The column <code>Account.currencyTransactionLog.id</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> id = createField("id", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.accountId</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> accountId = createField("accountId", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.currencyType</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> currencyType = createField("currencyType", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.change</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> change = createField("change", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.total</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> total = createField("total", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
/**
* The column <code>Account.currencyTransactionLog.timestamp</code>.
*/
public final org.jooq.TableField<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.sql.Timestamp> timestamp = createField("timestamp", org.jooq.impl.SQLDataType.TIMESTAMP.nullable(false).defaulted(true), this, "");
/**
* Create a <code>Account.currencyTransactionLog</code> table reference
*/
public CurrencyTransactionLog() {
this("currencyTransactionLog", null);
}
/**
* Create an aliased <code>Account.currencyTransactionLog</code> table reference
*/
public CurrencyTransactionLog(java.lang.String alias) {
this(alias, mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog);
}
private CurrencyTransactionLog(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.CurrencyTransactionLogRecord> aliased) {
this(alias, aliased, null);
}
private CurrencyTransactionLog(java.lang.String alias, org.jooq.Table<mineplex.database.tables.records.CurrencyTransactionLogRecord> aliased, org.jooq.Field<?>[] parameters) {
super(alias, mineplex.database.Account.Account, aliased, parameters, "");
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Identity<mineplex.database.tables.records.CurrencyTransactionLogRecord, java.lang.Integer> getIdentity() {
return mineplex.database.Keys.IDENTITY_currencyTransactionLog;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord> getPrimaryKey() {
return mineplex.database.Keys.KEY_currencyTransactionLog_PRIMARY;
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord>> getKeys() {
return java.util.Arrays.<org.jooq.UniqueKey<mineplex.database.tables.records.CurrencyTransactionLogRecord>>asList(mineplex.database.Keys.KEY_currencyTransactionLog_PRIMARY);
}
/**
* {@inheritDoc}
*/
@Override
public java.util.List<org.jooq.ForeignKey<mineplex.database.tables.records.CurrencyTransactionLogRecord, ?>> getReferences() {
return java.util.Arrays.<org.jooq.ForeignKey<mineplex.database.tables.records.CurrencyTransactionLogRecord, ?>>asList(mineplex.database.Keys.FK_currencyTransactionLog_accounts);
}
/**
* {@inheritDoc}
*/
@Override
public mineplex.database.tables.CurrencyTransactionLog as(java.lang.String alias) {
return new mineplex.database.tables.CurrencyTransactionLog(alias, this);
}
/**
* Rename this table
*/
public mineplex.database.tables.CurrencyTransactionLog rename(java.lang.String name) {
return new mineplex.database.tables.CurrencyTransactionLog(name, null);
}
}

View File

@ -9,9 +9,9 @@ package mineplex.database.tables.records;
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.lang.String, java.lang.String> {
public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.AccountsRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.sql.Timestamp, java.lang.String> {
private static final long serialVersionUID = 902357087;
private static final long serialVersionUID = 1410845092;
/**
* Setter for <code>Account.accounts.id</code>.
@ -114,15 +114,15 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
/**
* Setter for <code>Account.accounts.lastLogin</code>.
*/
public void setLastLogin(java.lang.String value) {
public void setLastLogin(java.sql.Timestamp value) {
setValue(7, value);
}
/**
* Getter for <code>Account.accounts.lastLogin</code>.
*/
public java.lang.String getLastLogin() {
return (java.lang.String) getValue(7);
public java.sql.Timestamp getLastLogin() {
return (java.sql.Timestamp) getValue(7);
}
/**
@ -159,7 +159,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public org.jooq.Row9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.lang.String, java.lang.String> fieldsRow() {
public org.jooq.Row9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.sql.Timestamp, java.lang.String> fieldsRow() {
return (org.jooq.Row9) super.fieldsRow();
}
@ -167,7 +167,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public org.jooq.Row9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.lang.String, java.lang.String> valuesRow() {
public org.jooq.Row9<java.lang.Integer, java.lang.String, java.lang.String, java.lang.Integer, java.lang.String, java.lang.Byte, java.lang.String, java.sql.Timestamp, java.lang.String> valuesRow() {
return (org.jooq.Row9) super.valuesRow();
}
@ -231,7 +231,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.String> field8() {
public org.jooq.Field<java.sql.Timestamp> field8() {
return mineplex.database.tables.Accounts.accounts.lastLogin;
}
@ -303,7 +303,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public java.lang.String value8() {
public java.sql.Timestamp value8() {
return getLastLogin();
}
@ -382,7 +382,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public AccountsRecord value8(java.lang.String value) {
public AccountsRecord value8(java.sql.Timestamp value) {
setLastLogin(value);
return this;
}
@ -400,7 +400,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
* {@inheritDoc}
*/
@Override
public AccountsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Integer value4, java.lang.String value5, java.lang.Byte value6, java.lang.String value7, java.lang.String value8, java.lang.String value9) {
public AccountsRecord values(java.lang.Integer value1, java.lang.String value2, java.lang.String value3, java.lang.Integer value4, java.lang.String value5, java.lang.Byte value6, java.lang.String value7, java.sql.Timestamp value8, java.lang.String value9) {
return this;
}
@ -418,7 +418,7 @@ public class AccountsRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.d
/**
* Create a detached, initialised AccountsRecord
*/
public AccountsRecord(java.lang.Integer id, java.lang.String uuid, java.lang.String name, java.lang.Integer gems, java.lang.String rank, java.lang.Byte rankPerm, java.lang.String rankExpire, java.lang.String lastLogin, java.lang.String totalPlayTime) {
public AccountsRecord(java.lang.Integer id, java.lang.String uuid, java.lang.String name, java.lang.Integer gems, java.lang.String rank, java.lang.Byte rankPerm, java.lang.String rankExpire, java.sql.Timestamp lastLogin, java.lang.String totalPlayTime) {
super(mineplex.database.tables.Accounts.accounts);
setValue(0, id);

View File

@ -0,0 +1,314 @@
/**
* This class is generated by jOOQ
*/
package mineplex.database.tables.records;
/**
* This class is generated by jOOQ.
*/
@javax.annotation.Generated(value = { "http://www.jooq.org", "3.4.2" },
comments = "This class is generated by jOOQ")
@java.lang.SuppressWarnings({ "all", "unchecked", "rawtypes" })
public class CurrencyTransactionLogRecord extends org.jooq.impl.UpdatableRecordImpl<mineplex.database.tables.records.CurrencyTransactionLogRecord> implements java.io.Serializable, java.lang.Cloneable, org.jooq.Record6<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp> {
private static final long serialVersionUID = -1864583043;
/**
* Setter for <code>Account.currencyTransactionLog.id</code>.
*/
public void setId(java.lang.Integer value) {
setValue(0, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.id</code>.
*/
public java.lang.Integer getId() {
return (java.lang.Integer) getValue(0);
}
/**
* Setter for <code>Account.currencyTransactionLog.accountId</code>.
*/
public void setAccountId(java.lang.Integer value) {
setValue(1, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.accountId</code>.
*/
public java.lang.Integer getAccountId() {
return (java.lang.Integer) getValue(1);
}
/**
* Setter for <code>Account.currencyTransactionLog.currencyType</code>.
*/
public void setCurrencyType(java.lang.Integer value) {
setValue(2, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.currencyType</code>.
*/
public java.lang.Integer getCurrencyType() {
return (java.lang.Integer) getValue(2);
}
/**
* Setter for <code>Account.currencyTransactionLog.change</code>.
*/
public void setChange(java.lang.Integer value) {
setValue(3, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.change</code>.
*/
public java.lang.Integer getChange() {
return (java.lang.Integer) getValue(3);
}
/**
* Setter for <code>Account.currencyTransactionLog.total</code>.
*/
public void setTotal(java.lang.Integer value) {
setValue(4, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.total</code>.
*/
public java.lang.Integer getTotal() {
return (java.lang.Integer) getValue(4);
}
/**
* Setter for <code>Account.currencyTransactionLog.timestamp</code>.
*/
public void setTimestamp(java.sql.Timestamp value) {
setValue(5, value);
}
/**
* Getter for <code>Account.currencyTransactionLog.timestamp</code>.
*/
public java.sql.Timestamp getTimestamp() {
return (java.sql.Timestamp) getValue(5);
}
// -------------------------------------------------------------------------
// Primary key information
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Record1<java.lang.Integer> key() {
return (org.jooq.Record1) super.key();
}
// -------------------------------------------------------------------------
// Record6 type implementation
// -------------------------------------------------------------------------
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row6<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp> fieldsRow() {
return (org.jooq.Row6) super.fieldsRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Row6<java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.lang.Integer, java.sql.Timestamp> valuesRow() {
return (org.jooq.Row6) super.valuesRow();
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field1() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.id;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field2() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.accountId;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field3() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.currencyType;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field4() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.change;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.lang.Integer> field5() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.total;
}
/**
* {@inheritDoc}
*/
@Override
public org.jooq.Field<java.sql.Timestamp> field6() {
return mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog.timestamp;
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value1() {
return getId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value2() {
return getAccountId();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value3() {
return getCurrencyType();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value4() {
return getChange();
}
/**
* {@inheritDoc}
*/
@Override
public java.lang.Integer value5() {
return getTotal();
}
/**
* {@inheritDoc}
*/
@Override
public java.sql.Timestamp value6() {
return getTimestamp();
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value1(java.lang.Integer value) {
setId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value2(java.lang.Integer value) {
setAccountId(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value3(java.lang.Integer value) {
setCurrencyType(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value4(java.lang.Integer value) {
setChange(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value5(java.lang.Integer value) {
setTotal(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord value6(java.sql.Timestamp value) {
setTimestamp(value);
return this;
}
/**
* {@inheritDoc}
*/
@Override
public CurrencyTransactionLogRecord values(java.lang.Integer value1, java.lang.Integer value2, java.lang.Integer value3, java.lang.Integer value4, java.lang.Integer value5, java.sql.Timestamp value6) {
return this;
}
// -------------------------------------------------------------------------
// Constructors
// -------------------------------------------------------------------------
/**
* Create a detached CurrencyTransactionLogRecord
*/
public CurrencyTransactionLogRecord() {
super(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog);
}
/**
* Create a detached, initialised CurrencyTransactionLogRecord
*/
public CurrencyTransactionLogRecord(java.lang.Integer id, java.lang.Integer accountId, java.lang.Integer currencyType, java.lang.Integer change, java.lang.Integer total, java.sql.Timestamp timestamp) {
super(mineplex.database.tables.CurrencyTransactionLog.currencyTransactionLog);
setValue(0, id);
setValue(1, accountId);
setValue(2, currencyType);
setValue(3, change);
setValue(4, total);
setValue(5, timestamp);
}
}