client: Add database (#1424)
* client: Add h2 and jooq * client: Add database manager * client: Add a helper to generate JOOQ classes * client: Add JOOQ classes * loottracker: Create database tables when they don't exist on startup * loottracker: Only migrate if datasource exists
This commit is contained in:
@@ -50,6 +50,7 @@ ext {
|
||||
jna = '5.4.0'
|
||||
jogamp = '2.3.2'
|
||||
jopt = '5.0.4'
|
||||
jooq = '3.11.12'
|
||||
junit = '4.12'
|
||||
jupiter = '5.5.1'
|
||||
logback = '1.2.3'
|
||||
|
||||
@@ -18,6 +18,7 @@ dependencies {
|
||||
implementation group: 'com.google.code.gson', name: 'gson', version: gson
|
||||
implementation group: 'com.google.guava', name: 'guava', version: guava
|
||||
implementation group: 'com.google.inject', name: 'guice', version: guice, classifier: 'no_aop'
|
||||
implementation group: 'com.h2database', name: 'h2', version: h2
|
||||
implementation group: 'com.jakewharton.rxrelay2', name: 'rxrelay', version: rxrelay
|
||||
implementation group: 'com.squareup.okhttp3', name: 'okhttp', version: okhttp3
|
||||
implementation group: 'io.reactivex.rxjava2', name: 'rxjava', version: rxjava
|
||||
@@ -34,6 +35,9 @@ dependencies {
|
||||
implementation group: 'org.jetbrains', name: 'annotations', version: annotations
|
||||
implementation group: 'org.jogamp.gluegen', name: 'gluegen-rt', version: jogamp
|
||||
implementation group: 'org.jogamp.jogl', name: 'jogl-all', version: jogamp
|
||||
implementation group: 'org.jooq', name: 'jooq', version: jooq
|
||||
implementation group: 'org.jooq', name: 'jooq-codegen', version: jooq
|
||||
implementation group: 'org.jooq', name: 'jooq-meta', version: jooq
|
||||
implementation group: 'org.ow2.asm', name: 'asm-tree', version: asm
|
||||
implementation group: 'org.slf4j', name: 'slf4j-api', version: slf4j
|
||||
implementation group: 'org.xeustechnologies', name: 'jcl-core', version: jclCore
|
||||
|
||||
@@ -0,0 +1,87 @@
|
||||
package net.runelite.client.database;
|
||||
|
||||
import java.io.File;
|
||||
import java.sql.Connection;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import javax.inject.Singleton;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import static net.runelite.client.RuneLite.RUNELITE_DIR;
|
||||
import org.h2.jdbcx.JdbcDataSource;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.SQLDialect;
|
||||
import org.jooq.impl.DSL;
|
||||
|
||||
@Singleton
|
||||
@Slf4j
|
||||
public class DatabaseManager
|
||||
{
|
||||
private static final String DB_URL = "jdbc:h2:" + RUNELITE_DIR + File.separator + "RunelitePlus;AUTO_SERVER=TRUE";
|
||||
|
||||
// Database credentials
|
||||
private static final String USER = "RLP";
|
||||
private static final String PASS = "";
|
||||
|
||||
private Connection connection;
|
||||
|
||||
DatabaseManager()
|
||||
{
|
||||
System.getProperties().setProperty("org.jooq.no-logo", "true");
|
||||
}
|
||||
|
||||
private void connect()
|
||||
{
|
||||
if (connection != null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
JdbcDataSource ds = new JdbcDataSource();
|
||||
ds.setURL(DatabaseManager.DB_URL);
|
||||
ds.setUser(DatabaseManager.USER);
|
||||
ds.setPassword(DatabaseManager.PASS);
|
||||
|
||||
try
|
||||
{
|
||||
connection = ds.getConnection();
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
Connection getConnection()
|
||||
{
|
||||
connect();
|
||||
|
||||
return connection;
|
||||
}
|
||||
|
||||
public DSLContext getDsl()
|
||||
{
|
||||
return DSL.using(connection, SQLDialect.H2);
|
||||
}
|
||||
|
||||
public boolean checkTableExists(String table)
|
||||
{
|
||||
boolean tableExists = false;
|
||||
|
||||
connect();
|
||||
|
||||
try
|
||||
{
|
||||
ResultSet rset = connection.getMetaData().getTables(null, null, table.toUpperCase(), null);
|
||||
if (rset.next())
|
||||
{
|
||||
tableExists = true;
|
||||
}
|
||||
}
|
||||
catch (SQLException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
return tableExists;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
package net.runelite.client.database;
|
||||
|
||||
import java.sql.Connection;
|
||||
import org.jooq.codegen.GenerationTool;
|
||||
import org.jooq.meta.h2.H2Database;
|
||||
import org.jooq.meta.jaxb.Configuration;
|
||||
import org.jooq.meta.jaxb.Database;
|
||||
import org.jooq.meta.jaxb.Generator;
|
||||
import org.jooq.meta.jaxb.Target;
|
||||
|
||||
public class GenerateClasses
|
||||
{
|
||||
public static void main(String... args)
|
||||
{
|
||||
DatabaseManager databaseManager = new DatabaseManager();
|
||||
|
||||
try (Connection c = databaseManager.getConnection())
|
||||
{
|
||||
Configuration configuration = new Configuration()
|
||||
.withGenerator(new Generator()
|
||||
.withDatabase(new Database()
|
||||
.withName(H2Database.class.getCanonicalName())
|
||||
.withIncludes(".*")
|
||||
.withExcludes("")
|
||||
.withInputSchema("PUBLIC")
|
||||
)
|
||||
.withTarget(new Target()
|
||||
.withPackageName("net.runelite.client.database.data")
|
||||
.withDirectory("runelite-client/src/main/java/net/runelite/client/database/data")
|
||||
)
|
||||
);
|
||||
|
||||
GenerationTool tool = new GenerationTool();
|
||||
tool.setConnection(c);
|
||||
tool.run(configuration);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,62 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.impl.CatalogImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class DefaultCatalog extends CatalogImpl
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 836257769;
|
||||
|
||||
/**
|
||||
* The reference instance of <code></code>
|
||||
*/
|
||||
public static final DefaultCatalog DEFAULT_CATALOG = new DefaultCatalog();
|
||||
|
||||
/**
|
||||
* The schema <code>PUBLIC</code>.
|
||||
*/
|
||||
public final Public PUBLIC = net.runelite.client.database.data.Public.PUBLIC;
|
||||
|
||||
/**
|
||||
* No further instances allowed
|
||||
*/
|
||||
private DefaultCatalog()
|
||||
{
|
||||
super("");
|
||||
}
|
||||
|
||||
@Override
|
||||
public final List<Schema> getSchemas()
|
||||
{
|
||||
List result = new ArrayList();
|
||||
result.addAll(getSchemas0());
|
||||
return result;
|
||||
}
|
||||
|
||||
private final List<Schema> getSchemas0()
|
||||
{
|
||||
return Arrays.<Schema>asList(
|
||||
Public.PUBLIC);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data;
|
||||
|
||||
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.Loottrackerevents;
|
||||
import net.runelite.client.database.data.tables.Loottrackerlink;
|
||||
import net.runelite.client.database.data.tables.Loottrackerloot;
|
||||
import net.runelite.client.database.data.tables.User;
|
||||
import org.jooq.Index;
|
||||
import org.jooq.OrderField;
|
||||
import org.jooq.impl.Internal;
|
||||
|
||||
|
||||
/**
|
||||
* A class modelling indexes of tables of the <code>PUBLIC</code> schema.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class Indexes
|
||||
{
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// INDEX definitions
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public static final Index PRIMARY_KEY_B = Indexes0.PRIMARY_KEY_B;
|
||||
public static final Index FK_LOOTTRACKEREVENT_INDEX_6 = Indexes0.FK_LOOTTRACKEREVENT_INDEX_6;
|
||||
public static final Index FK_LOOTTRACKERLOOT_INDEX_6 = Indexes0.FK_LOOTTRACKERLOOT_INDEX_6;
|
||||
public static final Index PRIMARY_KEY_6B = Indexes0.PRIMARY_KEY_6B;
|
||||
public static final Index PRIMARY_KEY_6 = Indexes0.PRIMARY_KEY_6;
|
||||
public static final Index PRIMARY_KEY_2 = Indexes0.PRIMARY_KEY_2;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// [#1459] distribute members to avoid static initialisers > 64kb
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
private static class Indexes0
|
||||
{
|
||||
public static Index PRIMARY_KEY_B = Internal.createIndex("PRIMARY_KEY_B", Loottrackerevents.LOOTTRACKEREVENTS, new OrderField[]{Loottrackerevents.LOOTTRACKEREVENTS.UNIQUEID}, true);
|
||||
public static Index FK_LOOTTRACKEREVENT_INDEX_6 = Internal.createIndex("FK_LOOTTRACKEREVENT_INDEX_6", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.EVENTUNIQUEID}, false);
|
||||
public static Index FK_LOOTTRACKERLOOT_INDEX_6 = Internal.createIndex("FK_LOOTTRACKERLOOT_INDEX_6", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID}, false);
|
||||
public static Index PRIMARY_KEY_6B = Internal.createIndex("PRIMARY_KEY_6B", Loottrackerlink.LOOTTRACKERLINK, new OrderField[]{Loottrackerlink.LOOTTRACKERLINK.LINKUNIQUEID}, true);
|
||||
public static Index PRIMARY_KEY_6 = Internal.createIndex("PRIMARY_KEY_6", Loottrackerloot.LOOTTRACKERLOOT, new OrderField[]{Loottrackerloot.LOOTTRACKERLOOT.UNIQUEID}, true);
|
||||
public static Index PRIMARY_KEY_2 = Internal.createIndex("PRIMARY_KEY_2", User.USER, new OrderField[]{User.USER.UNIQUEID}, true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data;
|
||||
|
||||
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.Loottrackerevents;
|
||||
import net.runelite.client.database.data.tables.Loottrackerlink;
|
||||
import net.runelite.client.database.data.tables.Loottrackerloot;
|
||||
import net.runelite.client.database.data.tables.User;
|
||||
import net.runelite.client.database.data.tables.records.LoottrackereventsRecord;
|
||||
import net.runelite.client.database.data.tables.records.LoottrackerlinkRecord;
|
||||
import net.runelite.client.database.data.tables.records.LoottrackerlootRecord;
|
||||
import net.runelite.client.database.data.tables.records.UserRecord;
|
||||
import org.jooq.ForeignKey;
|
||||
import org.jooq.UniqueKey;
|
||||
import org.jooq.impl.Internal;
|
||||
|
||||
|
||||
/**
|
||||
* A class modelling foreign key relationships and constraints of tables of
|
||||
* the <code>PUBLIC</code> schema.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class Keys
|
||||
{
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// IDENTITY definitions
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// UNIQUE and PRIMARY KEY definitions
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public static final UniqueKey<LoottrackereventsRecord> PK_EVENTUNIQUEID = UniqueKeys0.PK_EVENTUNIQUEID;
|
||||
public static final UniqueKey<LoottrackerlinkRecord> PK_LOOTTRACKERLINK = UniqueKeys0.PK_LOOTTRACKERLINK;
|
||||
public static final UniqueKey<LoottrackerlootRecord> PK_LOOTUNIQUEID = UniqueKeys0.PK_LOOTUNIQUEID;
|
||||
public static final UniqueKey<UserRecord> PK_USER = UniqueKeys0.PK_USER;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// FOREIGN KEY definitions
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
public static final ForeignKey<LoottrackerlinkRecord, LoottrackereventsRecord> FK_LOOTTRACKEREVENT = ForeignKeys0.FK_LOOTTRACKEREVENT;
|
||||
public static final ForeignKey<LoottrackerlinkRecord, LoottrackerlootRecord> FK_LOOTTRACKERLOOT = ForeignKeys0.FK_LOOTTRACKERLOOT;
|
||||
public static final ForeignKey<LoottrackerlinkRecord, UserRecord> FK_USER = ForeignKeys0.FK_USER;
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// [#1459] distribute members to avoid static initialisers > 64kb
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
private static class UniqueKeys0
|
||||
{
|
||||
public static final UniqueKey<LoottrackereventsRecord> PK_EVENTUNIQUEID = Internal.createUniqueKey(Loottrackerevents.LOOTTRACKEREVENTS, "PK_EVENTUNIQUEID", Loottrackerevents.LOOTTRACKEREVENTS.UNIQUEID);
|
||||
public static final UniqueKey<LoottrackerlinkRecord> PK_LOOTTRACKERLINK = Internal.createUniqueKey(Loottrackerlink.LOOTTRACKERLINK, "PK_LOOTTRACKERLINK", Loottrackerlink.LOOTTRACKERLINK.LINKUNIQUEID);
|
||||
public static final UniqueKey<LoottrackerlootRecord> PK_LOOTUNIQUEID = Internal.createUniqueKey(Loottrackerloot.LOOTTRACKERLOOT, "PK_LOOTUNIQUEID", Loottrackerloot.LOOTTRACKERLOOT.UNIQUEID);
|
||||
public static final UniqueKey<UserRecord> PK_USER = Internal.createUniqueKey(User.USER, "PK_USER", User.USER.UNIQUEID);
|
||||
}
|
||||
|
||||
private static class ForeignKeys0
|
||||
{
|
||||
public static final ForeignKey<LoottrackerlinkRecord, LoottrackereventsRecord> FK_LOOTTRACKEREVENT = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_EVENTUNIQUEID, Loottrackerlink.LOOTTRACKERLINK, "FK_LOOTTRACKEREVENT", Loottrackerlink.LOOTTRACKERLINK.EVENTUNIQUEID);
|
||||
public static final ForeignKey<LoottrackerlinkRecord, LoottrackerlootRecord> FK_LOOTTRACKERLOOT = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_LOOTUNIQUEID, Loottrackerlink.LOOTTRACKERLINK, "FK_LOOTTRACKERLOOT", Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID);
|
||||
public static final ForeignKey<LoottrackerlinkRecord, UserRecord> FK_USER = Internal.createForeignKey(net.runelite.client.database.data.Keys.PK_USER, Loottrackerlink.LOOTTRACKERLINK, "FK_USER", Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,95 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.Loottrackerevents;
|
||||
import net.runelite.client.database.data.tables.Loottrackerlink;
|
||||
import net.runelite.client.database.data.tables.Loottrackerloot;
|
||||
import net.runelite.client.database.data.tables.User;
|
||||
import org.jooq.Catalog;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.impl.SchemaImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class Public extends SchemaImpl
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1499404561;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>PUBLIC</code>
|
||||
*/
|
||||
public static final Public PUBLIC = new Public();
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.LOOTTRACKEREVENTS</code>.
|
||||
*/
|
||||
public final Loottrackerevents LOOTTRACKEREVENTS = net.runelite.client.database.data.tables.Loottrackerevents.LOOTTRACKEREVENTS;
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.LOOTTRACKERLINK</code>.
|
||||
*/
|
||||
public final Loottrackerlink LOOTTRACKERLINK = net.runelite.client.database.data.tables.Loottrackerlink.LOOTTRACKERLINK;
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.LOOTTRACKERLOOT</code>.
|
||||
*/
|
||||
public final Loottrackerloot LOOTTRACKERLOOT = net.runelite.client.database.data.tables.Loottrackerloot.LOOTTRACKERLOOT;
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.USER</code>.
|
||||
*/
|
||||
public final User USER = net.runelite.client.database.data.tables.User.USER;
|
||||
|
||||
/**
|
||||
* No further instances allowed
|
||||
*/
|
||||
private Public()
|
||||
{
|
||||
super("PUBLIC", null);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Catalog getCatalog()
|
||||
{
|
||||
return DefaultCatalog.DEFAULT_CATALOG;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final List<Table<?>> getTables()
|
||||
{
|
||||
List result = new ArrayList();
|
||||
result.addAll(getTables0());
|
||||
return result;
|
||||
}
|
||||
|
||||
private final List<Table<?>> getTables0()
|
||||
{
|
||||
return Arrays.<Table<?>>asList(
|
||||
Loottrackerevents.LOOTTRACKEREVENTS,
|
||||
Loottrackerlink.LOOTTRACKERLINK,
|
||||
Loottrackerloot.LOOTTRACKERLOOT,
|
||||
User.USER);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data;
|
||||
|
||||
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.Loottrackerevents;
|
||||
import net.runelite.client.database.data.tables.Loottrackerlink;
|
||||
import net.runelite.client.database.data.tables.Loottrackerloot;
|
||||
import net.runelite.client.database.data.tables.User;
|
||||
|
||||
|
||||
/**
|
||||
* Convenience access to all tables in PUBLIC
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class Tables
|
||||
{
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.LOOTTRACKEREVENTS</code>.
|
||||
*/
|
||||
public static final Loottrackerevents LOOTTRACKEREVENTS = net.runelite.client.database.data.tables.Loottrackerevents.LOOTTRACKEREVENTS;
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.LOOTTRACKERLINK</code>.
|
||||
*/
|
||||
public static final Loottrackerlink LOOTTRACKERLINK = net.runelite.client.database.data.tables.Loottrackerlink.LOOTTRACKERLINK;
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.LOOTTRACKERLOOT</code>.
|
||||
*/
|
||||
public static final Loottrackerloot LOOTTRACKERLOOT = net.runelite.client.database.data.tables.Loottrackerloot.LOOTTRACKERLOOT;
|
||||
|
||||
/**
|
||||
* The table <code>PUBLIC.USER</code>.
|
||||
*/
|
||||
public static final User USER = net.runelite.client.database.data.tables.User.USER;
|
||||
}
|
||||
@@ -0,0 +1,189 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables;
|
||||
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.Indexes;
|
||||
import net.runelite.client.database.data.Keys;
|
||||
import net.runelite.client.database.data.Public;
|
||||
import net.runelite.client.database.data.tables.records.LoottrackereventsRecord;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.ForeignKey;
|
||||
import org.jooq.Index;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.UniqueKey;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.TableImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class Loottrackerevents extends TableImpl<LoottrackereventsRecord>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -824670812;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>PUBLIC.LOOTTRACKEREVENTS</code>
|
||||
*/
|
||||
public static final Loottrackerevents LOOTTRACKEREVENTS = new Loottrackerevents();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public Class<LoottrackereventsRecord> getRecordType()
|
||||
{
|
||||
return LoottrackereventsRecord.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKEREVENTS.UNIQUEID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackereventsRecord, UUID> UNIQUEID = createField("UNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKEREVENTS.EVENTID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackereventsRecord, String> EVENTID = createField("EVENTID", org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKEREVENTS.TYPE</code>.
|
||||
*/
|
||||
public final TableField<LoottrackereventsRecord, String> TYPE = createField("TYPE", org.jooq.impl.SQLDataType.VARCHAR(255).nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKEREVENTS.TIME</code>.
|
||||
*/
|
||||
public final TableField<LoottrackereventsRecord, Timestamp> TIME = createField("TIME", org.jooq.impl.SQLDataType.TIMESTAMP.precision(6).nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>PUBLIC.LOOTTRACKEREVENTS</code> table reference
|
||||
*/
|
||||
public Loottrackerevents()
|
||||
{
|
||||
this(DSL.name("LOOTTRACKEREVENTS"), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.LOOTTRACKEREVENTS</code> table reference
|
||||
*/
|
||||
public Loottrackerevents(String alias)
|
||||
{
|
||||
this(DSL.name(alias), LOOTTRACKEREVENTS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.LOOTTRACKEREVENTS</code> table reference
|
||||
*/
|
||||
public Loottrackerevents(Name alias)
|
||||
{
|
||||
this(alias, LOOTTRACKEREVENTS);
|
||||
}
|
||||
|
||||
private Loottrackerevents(Name alias, Table<LoottrackereventsRecord> aliased)
|
||||
{
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private Loottrackerevents(Name alias, Table<LoottrackereventsRecord> aliased, Field<?>[] parameters)
|
||||
{
|
||||
super(alias, null, aliased, parameters, DSL.comment(""));
|
||||
}
|
||||
|
||||
public <O extends Record> Loottrackerevents(Table<O> child, ForeignKey<O, LoottrackereventsRecord> key)
|
||||
{
|
||||
super(child, key, LOOTTRACKEREVENTS);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Schema getSchema()
|
||||
{
|
||||
return Public.PUBLIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<Index> getIndexes()
|
||||
{
|
||||
return Arrays.<Index>asList(Indexes.PRIMARY_KEY_B);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UniqueKey<LoottrackereventsRecord> getPrimaryKey()
|
||||
{
|
||||
return Keys.PK_EVENTUNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<UniqueKey<LoottrackereventsRecord>> getKeys()
|
||||
{
|
||||
return Arrays.<UniqueKey<LoottrackereventsRecord>>asList(Keys.PK_EVENTUNIQUEID);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerevents as(String alias)
|
||||
{
|
||||
return new Loottrackerevents(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerevents as(Name alias)
|
||||
{
|
||||
return new Loottrackerevents(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerevents rename(String name)
|
||||
{
|
||||
return new Loottrackerevents(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerevents rename(Name name)
|
||||
{
|
||||
return new Loottrackerevents(name, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,212 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.Indexes;
|
||||
import net.runelite.client.database.data.Keys;
|
||||
import net.runelite.client.database.data.Public;
|
||||
import net.runelite.client.database.data.tables.records.LoottrackerlinkRecord;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.ForeignKey;
|
||||
import org.jooq.Index;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.UniqueKey;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.TableImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class Loottrackerlink extends TableImpl<LoottrackerlinkRecord>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1145289106;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>PUBLIC.LOOTTRACKERLINK</code>
|
||||
*/
|
||||
public static final Loottrackerlink LOOTTRACKERLINK = new Loottrackerlink();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public Class<LoottrackerlinkRecord> getRecordType()
|
||||
{
|
||||
return LoottrackerlinkRecord.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKERLINK.LINKUNIQUEID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackerlinkRecord, UUID> LINKUNIQUEID = createField("LINKUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKERLINK.EVENTUNIQUEID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackerlinkRecord, UUID> EVENTUNIQUEID = createField("EVENTUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKERLINK.DROPUNIQUEID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackerlinkRecord, UUID> DROPUNIQUEID = createField("DROPUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKERLINK.USERUNIQUEID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackerlinkRecord, UUID> USERUNIQUEID = createField("USERUNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>PUBLIC.LOOTTRACKERLINK</code> table reference
|
||||
*/
|
||||
public Loottrackerlink()
|
||||
{
|
||||
this(DSL.name("LOOTTRACKERLINK"), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.LOOTTRACKERLINK</code> table reference
|
||||
*/
|
||||
public Loottrackerlink(String alias)
|
||||
{
|
||||
this(DSL.name(alias), LOOTTRACKERLINK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.LOOTTRACKERLINK</code> table reference
|
||||
*/
|
||||
public Loottrackerlink(Name alias)
|
||||
{
|
||||
this(alias, LOOTTRACKERLINK);
|
||||
}
|
||||
|
||||
private Loottrackerlink(Name alias, Table<LoottrackerlinkRecord> aliased)
|
||||
{
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private Loottrackerlink(Name alias, Table<LoottrackerlinkRecord> aliased, Field<?>[] parameters)
|
||||
{
|
||||
super(alias, null, aliased, parameters, DSL.comment(""));
|
||||
}
|
||||
|
||||
public <O extends Record> Loottrackerlink(Table<O> child, ForeignKey<O, LoottrackerlinkRecord> key)
|
||||
{
|
||||
super(child, key, LOOTTRACKERLINK);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Schema getSchema()
|
||||
{
|
||||
return Public.PUBLIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<Index> getIndexes()
|
||||
{
|
||||
return Arrays.<Index>asList(Indexes.FK_LOOTTRACKEREVENT_INDEX_6, Indexes.FK_LOOTTRACKERLOOT_INDEX_6, Indexes.PRIMARY_KEY_6B);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UniqueKey<LoottrackerlinkRecord> getPrimaryKey()
|
||||
{
|
||||
return Keys.PK_LOOTTRACKERLINK;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<UniqueKey<LoottrackerlinkRecord>> getKeys()
|
||||
{
|
||||
return Arrays.<UniqueKey<LoottrackerlinkRecord>>asList(Keys.PK_LOOTTRACKERLINK);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<ForeignKey<LoottrackerlinkRecord, ?>> getReferences()
|
||||
{
|
||||
return Arrays.<ForeignKey<LoottrackerlinkRecord, ?>>asList(Keys.FK_LOOTTRACKEREVENT, Keys.FK_LOOTTRACKERLOOT, Keys.FK_USER);
|
||||
}
|
||||
|
||||
public Loottrackerevents loottrackerevents()
|
||||
{
|
||||
return new Loottrackerevents(this, Keys.FK_LOOTTRACKEREVENT);
|
||||
}
|
||||
|
||||
public Loottrackerloot loottrackerloot()
|
||||
{
|
||||
return new Loottrackerloot(this, Keys.FK_LOOTTRACKERLOOT);
|
||||
}
|
||||
|
||||
public User user()
|
||||
{
|
||||
return new User(this, Keys.FK_USER);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerlink as(String alias)
|
||||
{
|
||||
return new Loottrackerlink(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerlink as(Name alias)
|
||||
{
|
||||
return new Loottrackerlink(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerlink rename(String name)
|
||||
{
|
||||
return new Loottrackerlink(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerlink rename(Name name)
|
||||
{
|
||||
return new Loottrackerlink(name, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,183 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.Indexes;
|
||||
import net.runelite.client.database.data.Keys;
|
||||
import net.runelite.client.database.data.Public;
|
||||
import net.runelite.client.database.data.tables.records.LoottrackerlootRecord;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.ForeignKey;
|
||||
import org.jooq.Index;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.UniqueKey;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.TableImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class Loottrackerloot extends TableImpl<LoottrackerlootRecord>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1952959378;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>PUBLIC.LOOTTRACKERLOOT</code>
|
||||
*/
|
||||
public static final Loottrackerloot LOOTTRACKERLOOT = new Loottrackerloot();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public Class<LoottrackerlootRecord> getRecordType()
|
||||
{
|
||||
return LoottrackerlootRecord.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKERLOOT.UNIQUEID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackerlootRecord, UUID> UNIQUEID = createField("UNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKERLOOT.ITEMID</code>.
|
||||
*/
|
||||
public final TableField<LoottrackerlootRecord, Integer> ITEMID = createField("ITEMID", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.LOOTTRACKERLOOT.QUANTITY</code>.
|
||||
*/
|
||||
public final TableField<LoottrackerlootRecord, Integer> QUANTITY = createField("QUANTITY", org.jooq.impl.SQLDataType.INTEGER.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>PUBLIC.LOOTTRACKERLOOT</code> table reference
|
||||
*/
|
||||
public Loottrackerloot()
|
||||
{
|
||||
this(DSL.name("LOOTTRACKERLOOT"), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.LOOTTRACKERLOOT</code> table reference
|
||||
*/
|
||||
public Loottrackerloot(String alias)
|
||||
{
|
||||
this(DSL.name(alias), LOOTTRACKERLOOT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.LOOTTRACKERLOOT</code> table reference
|
||||
*/
|
||||
public Loottrackerloot(Name alias)
|
||||
{
|
||||
this(alias, LOOTTRACKERLOOT);
|
||||
}
|
||||
|
||||
private Loottrackerloot(Name alias, Table<LoottrackerlootRecord> aliased)
|
||||
{
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private Loottrackerloot(Name alias, Table<LoottrackerlootRecord> aliased, Field<?>[] parameters)
|
||||
{
|
||||
super(alias, null, aliased, parameters, DSL.comment(""));
|
||||
}
|
||||
|
||||
public <O extends Record> Loottrackerloot(Table<O> child, ForeignKey<O, LoottrackerlootRecord> key)
|
||||
{
|
||||
super(child, key, LOOTTRACKERLOOT);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Schema getSchema()
|
||||
{
|
||||
return Public.PUBLIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<Index> getIndexes()
|
||||
{
|
||||
return Arrays.<Index>asList(Indexes.PRIMARY_KEY_6);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UniqueKey<LoottrackerlootRecord> getPrimaryKey()
|
||||
{
|
||||
return Keys.PK_LOOTUNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<UniqueKey<LoottrackerlootRecord>> getKeys()
|
||||
{
|
||||
return Arrays.<UniqueKey<LoottrackerlootRecord>>asList(Keys.PK_LOOTUNIQUEID);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerloot as(String alias)
|
||||
{
|
||||
return new Loottrackerloot(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerloot as(Name alias)
|
||||
{
|
||||
return new Loottrackerloot(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerloot rename(String name)
|
||||
{
|
||||
return new Loottrackerloot(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public Loottrackerloot rename(Name name)
|
||||
{
|
||||
return new Loottrackerloot(name, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,178 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables;
|
||||
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.Indexes;
|
||||
import net.runelite.client.database.data.Keys;
|
||||
import net.runelite.client.database.data.Public;
|
||||
import net.runelite.client.database.data.tables.records.UserRecord;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.ForeignKey;
|
||||
import org.jooq.Index;
|
||||
import org.jooq.Name;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Schema;
|
||||
import org.jooq.Table;
|
||||
import org.jooq.TableField;
|
||||
import org.jooq.UniqueKey;
|
||||
import org.jooq.impl.DSL;
|
||||
import org.jooq.impl.TableImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class User extends TableImpl<UserRecord>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 270848699;
|
||||
|
||||
/**
|
||||
* The reference instance of <code>PUBLIC.USER</code>
|
||||
*/
|
||||
public static final User USER = new User();
|
||||
|
||||
/**
|
||||
* The class holding records for this type
|
||||
*/
|
||||
@Override
|
||||
public Class<UserRecord> getRecordType()
|
||||
{
|
||||
return UserRecord.class;
|
||||
}
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.USER.UNIQUEID</code>.
|
||||
*/
|
||||
public final TableField<UserRecord, UUID> UNIQUEID = createField("UNIQUEID", org.jooq.impl.SQLDataType.UUID.nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* The column <code>PUBLIC.USER.USERNAME</code>.
|
||||
*/
|
||||
public final TableField<UserRecord, String> USERNAME = createField("USERNAME", org.jooq.impl.SQLDataType.VARCHAR(12).nullable(false), this, "");
|
||||
|
||||
/**
|
||||
* Create a <code>PUBLIC.USER</code> table reference
|
||||
*/
|
||||
public User()
|
||||
{
|
||||
this(DSL.name("USER"), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.USER</code> table reference
|
||||
*/
|
||||
public User(String alias)
|
||||
{
|
||||
this(DSL.name(alias), USER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create an aliased <code>PUBLIC.USER</code> table reference
|
||||
*/
|
||||
public User(Name alias)
|
||||
{
|
||||
this(alias, USER);
|
||||
}
|
||||
|
||||
private User(Name alias, Table<UserRecord> aliased)
|
||||
{
|
||||
this(alias, aliased, null);
|
||||
}
|
||||
|
||||
private User(Name alias, Table<UserRecord> aliased, Field<?>[] parameters)
|
||||
{
|
||||
super(alias, null, aliased, parameters, DSL.comment(""));
|
||||
}
|
||||
|
||||
public <O extends Record> User(Table<O> child, ForeignKey<O, UserRecord> key)
|
||||
{
|
||||
super(child, key, USER);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Schema getSchema()
|
||||
{
|
||||
return Public.PUBLIC;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<Index> getIndexes()
|
||||
{
|
||||
return Arrays.<Index>asList(Indexes.PRIMARY_KEY_2);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UniqueKey<UserRecord> getPrimaryKey()
|
||||
{
|
||||
return Keys.PK_USER;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public List<UniqueKey<UserRecord>> getKeys()
|
||||
{
|
||||
return Arrays.<UniqueKey<UserRecord>>asList(Keys.PK_USER);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public User as(String alias)
|
||||
{
|
||||
return new User(DSL.name(alias), this);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public User as(Name alias)
|
||||
{
|
||||
return new User(alias, this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public User rename(String name)
|
||||
{
|
||||
return new User(DSL.name(name), null);
|
||||
}
|
||||
|
||||
/**
|
||||
* Rename this table
|
||||
*/
|
||||
@Override
|
||||
public User rename(Name name)
|
||||
{
|
||||
return new User(name, null);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,318 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables.records;
|
||||
|
||||
|
||||
import java.sql.Timestamp;
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.Loottrackerevents;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Row4;
|
||||
import org.jooq.impl.UpdatableRecordImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class LoottrackereventsRecord extends UpdatableRecordImpl<LoottrackereventsRecord> implements Record4<UUID, String, String, Timestamp>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -1505143967;
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKEREVENTS.UNIQUEID</code>.
|
||||
*/
|
||||
public void setUniqueid(UUID value)
|
||||
{
|
||||
set(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKEREVENTS.UNIQUEID</code>.
|
||||
*/
|
||||
public UUID getUniqueid()
|
||||
{
|
||||
return (UUID) get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKEREVENTS.EVENTID</code>.
|
||||
*/
|
||||
public void setEventid(String value)
|
||||
{
|
||||
set(1, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKEREVENTS.EVENTID</code>.
|
||||
*/
|
||||
public String getEventid()
|
||||
{
|
||||
return (String) get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKEREVENTS.TYPE</code>.
|
||||
*/
|
||||
public void setType(String value)
|
||||
{
|
||||
set(2, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKEREVENTS.TYPE</code>.
|
||||
*/
|
||||
public String getType()
|
||||
{
|
||||
return (String) get(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKEREVENTS.TIME</code>.
|
||||
*/
|
||||
public void setTime(Timestamp value)
|
||||
{
|
||||
set(3, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKEREVENTS.TIME</code>.
|
||||
*/
|
||||
public Timestamp getTime()
|
||||
{
|
||||
return (Timestamp) get(3);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Record1<UUID> key()
|
||||
{
|
||||
return (Record1) super.key();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record4 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row4<UUID, String, String, Timestamp> fieldsRow()
|
||||
{
|
||||
return (Row4) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row4<UUID, String, String, Timestamp> valuesRow()
|
||||
{
|
||||
return (Row4) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<UUID> field1()
|
||||
{
|
||||
return Loottrackerevents.LOOTTRACKEREVENTS.UNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<String> field2()
|
||||
{
|
||||
return Loottrackerevents.LOOTTRACKEREVENTS.EVENTID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<String> field3()
|
||||
{
|
||||
return Loottrackerevents.LOOTTRACKEREVENTS.TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<Timestamp> field4()
|
||||
{
|
||||
return Loottrackerevents.LOOTTRACKEREVENTS.TIME;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID component1()
|
||||
{
|
||||
return getUniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String component2()
|
||||
{
|
||||
return getEventid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String component3()
|
||||
{
|
||||
return getType();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Timestamp component4()
|
||||
{
|
||||
return getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID value1()
|
||||
{
|
||||
return getUniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String value2()
|
||||
{
|
||||
return getEventid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String value3()
|
||||
{
|
||||
return getType();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Timestamp value4()
|
||||
{
|
||||
return getTime();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackereventsRecord value1(UUID value)
|
||||
{
|
||||
setUniqueid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackereventsRecord value2(String value)
|
||||
{
|
||||
setEventid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackereventsRecord value3(String value)
|
||||
{
|
||||
setType(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackereventsRecord value4(Timestamp value)
|
||||
{
|
||||
setTime(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackereventsRecord values(UUID value1, String value2, String value3, Timestamp value4)
|
||||
{
|
||||
value1(value1);
|
||||
value2(value2);
|
||||
value3(value3);
|
||||
value4(value4);
|
||||
return this;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a detached LoottrackereventsRecord
|
||||
*/
|
||||
public LoottrackereventsRecord()
|
||||
{
|
||||
super(Loottrackerevents.LOOTTRACKEREVENTS);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a detached, initialised LoottrackereventsRecord
|
||||
*/
|
||||
public LoottrackereventsRecord(UUID uniqueid, String eventid, String type, Timestamp time)
|
||||
{
|
||||
super(Loottrackerevents.LOOTTRACKEREVENTS);
|
||||
|
||||
set(0, uniqueid);
|
||||
set(1, eventid);
|
||||
set(2, type);
|
||||
set(3, time);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,317 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables.records;
|
||||
|
||||
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.Loottrackerlink;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record4;
|
||||
import org.jooq.Row4;
|
||||
import org.jooq.impl.UpdatableRecordImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class LoottrackerlinkRecord extends UpdatableRecordImpl<LoottrackerlinkRecord> implements Record4<UUID, UUID, UUID, UUID>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 1985117517;
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKERLINK.LINKUNIQUEID</code>.
|
||||
*/
|
||||
public void setLinkuniqueid(UUID value)
|
||||
{
|
||||
set(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKERLINK.LINKUNIQUEID</code>.
|
||||
*/
|
||||
public UUID getLinkuniqueid()
|
||||
{
|
||||
return (UUID) get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKERLINK.EVENTUNIQUEID</code>.
|
||||
*/
|
||||
public void setEventuniqueid(UUID value)
|
||||
{
|
||||
set(1, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKERLINK.EVENTUNIQUEID</code>.
|
||||
*/
|
||||
public UUID getEventuniqueid()
|
||||
{
|
||||
return (UUID) get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKERLINK.DROPUNIQUEID</code>.
|
||||
*/
|
||||
public void setDropuniqueid(UUID value)
|
||||
{
|
||||
set(2, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKERLINK.DROPUNIQUEID</code>.
|
||||
*/
|
||||
public UUID getDropuniqueid()
|
||||
{
|
||||
return (UUID) get(2);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKERLINK.USERUNIQUEID</code>.
|
||||
*/
|
||||
public void setUseruniqueid(UUID value)
|
||||
{
|
||||
set(3, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKERLINK.USERUNIQUEID</code>.
|
||||
*/
|
||||
public UUID getUseruniqueid()
|
||||
{
|
||||
return (UUID) get(3);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Record1<UUID> key()
|
||||
{
|
||||
return (Record1) super.key();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record4 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row4<UUID, UUID, UUID, UUID> fieldsRow()
|
||||
{
|
||||
return (Row4) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row4<UUID, UUID, UUID, UUID> valuesRow()
|
||||
{
|
||||
return (Row4) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<UUID> field1()
|
||||
{
|
||||
return Loottrackerlink.LOOTTRACKERLINK.LINKUNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<UUID> field2()
|
||||
{
|
||||
return Loottrackerlink.LOOTTRACKERLINK.EVENTUNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<UUID> field3()
|
||||
{
|
||||
return Loottrackerlink.LOOTTRACKERLINK.DROPUNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<UUID> field4()
|
||||
{
|
||||
return Loottrackerlink.LOOTTRACKERLINK.USERUNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID component1()
|
||||
{
|
||||
return getLinkuniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID component2()
|
||||
{
|
||||
return getEventuniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID component3()
|
||||
{
|
||||
return getDropuniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID component4()
|
||||
{
|
||||
return getUseruniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID value1()
|
||||
{
|
||||
return getLinkuniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID value2()
|
||||
{
|
||||
return getEventuniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID value3()
|
||||
{
|
||||
return getDropuniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID value4()
|
||||
{
|
||||
return getUseruniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlinkRecord value1(UUID value)
|
||||
{
|
||||
setLinkuniqueid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlinkRecord value2(UUID value)
|
||||
{
|
||||
setEventuniqueid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlinkRecord value3(UUID value)
|
||||
{
|
||||
setDropuniqueid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlinkRecord value4(UUID value)
|
||||
{
|
||||
setUseruniqueid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlinkRecord values(UUID value1, UUID value2, UUID value3, UUID value4)
|
||||
{
|
||||
value1(value1);
|
||||
value2(value2);
|
||||
value3(value3);
|
||||
value4(value4);
|
||||
return this;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a detached LoottrackerlinkRecord
|
||||
*/
|
||||
public LoottrackerlinkRecord()
|
||||
{
|
||||
super(Loottrackerlink.LOOTTRACKERLINK);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a detached, initialised LoottrackerlinkRecord
|
||||
*/
|
||||
public LoottrackerlinkRecord(UUID linkuniqueid, UUID eventuniqueid, UUID dropuniqueid, UUID useruniqueid)
|
||||
{
|
||||
super(Loottrackerlink.LOOTTRACKERLINK);
|
||||
|
||||
set(0, linkuniqueid);
|
||||
set(1, eventuniqueid);
|
||||
set(2, dropuniqueid);
|
||||
set(3, useruniqueid);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,262 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables.records;
|
||||
|
||||
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.Loottrackerloot;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record3;
|
||||
import org.jooq.Row3;
|
||||
import org.jooq.impl.UpdatableRecordImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class LoottrackerlootRecord extends UpdatableRecordImpl<LoottrackerlootRecord> implements Record3<UUID, Integer, Integer>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = -1894768090;
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKERLOOT.UNIQUEID</code>.
|
||||
*/
|
||||
public void setUniqueid(UUID value)
|
||||
{
|
||||
set(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKERLOOT.UNIQUEID</code>.
|
||||
*/
|
||||
public UUID getUniqueid()
|
||||
{
|
||||
return (UUID) get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKERLOOT.ITEMID</code>.
|
||||
*/
|
||||
public void setItemid(Integer value)
|
||||
{
|
||||
set(1, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKERLOOT.ITEMID</code>.
|
||||
*/
|
||||
public Integer getItemid()
|
||||
{
|
||||
return (Integer) get(1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.LOOTTRACKERLOOT.QUANTITY</code>.
|
||||
*/
|
||||
public void setQuantity(Integer value)
|
||||
{
|
||||
set(2, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.LOOTTRACKERLOOT.QUANTITY</code>.
|
||||
*/
|
||||
public Integer getQuantity()
|
||||
{
|
||||
return (Integer) get(2);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Record1<UUID> key()
|
||||
{
|
||||
return (Record1) super.key();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record3 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row3<UUID, Integer, Integer> fieldsRow()
|
||||
{
|
||||
return (Row3) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row3<UUID, Integer, Integer> valuesRow()
|
||||
{
|
||||
return (Row3) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<UUID> field1()
|
||||
{
|
||||
return Loottrackerloot.LOOTTRACKERLOOT.UNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<Integer> field2()
|
||||
{
|
||||
return Loottrackerloot.LOOTTRACKERLOOT.ITEMID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<Integer> field3()
|
||||
{
|
||||
return Loottrackerloot.LOOTTRACKERLOOT.QUANTITY;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID component1()
|
||||
{
|
||||
return getUniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Integer component2()
|
||||
{
|
||||
return getItemid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Integer component3()
|
||||
{
|
||||
return getQuantity();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID value1()
|
||||
{
|
||||
return getUniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Integer value2()
|
||||
{
|
||||
return getItemid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Integer value3()
|
||||
{
|
||||
return getQuantity();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlootRecord value1(UUID value)
|
||||
{
|
||||
setUniqueid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlootRecord value2(Integer value)
|
||||
{
|
||||
setItemid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlootRecord value3(Integer value)
|
||||
{
|
||||
setQuantity(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public LoottrackerlootRecord values(UUID value1, Integer value2, Integer value3)
|
||||
{
|
||||
value1(value1);
|
||||
value2(value2);
|
||||
value3(value3);
|
||||
return this;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a detached LoottrackerlootRecord
|
||||
*/
|
||||
public LoottrackerlootRecord()
|
||||
{
|
||||
super(Loottrackerloot.LOOTTRACKERLOOT);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a detached, initialised LoottrackerlootRecord
|
||||
*/
|
||||
public LoottrackerlootRecord(UUID uniqueid, Integer itemid, Integer quantity)
|
||||
{
|
||||
super(Loottrackerloot.LOOTTRACKERLOOT);
|
||||
|
||||
set(0, uniqueid);
|
||||
set(1, itemid);
|
||||
set(2, quantity);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,207 @@
|
||||
/*
|
||||
* This file is generated by jOOQ.
|
||||
*/
|
||||
package net.runelite.client.database.data.tables.records;
|
||||
|
||||
|
||||
import java.util.UUID;
|
||||
import javax.annotation.Generated;
|
||||
import net.runelite.client.database.data.tables.User;
|
||||
import org.jooq.Field;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record2;
|
||||
import org.jooq.Row2;
|
||||
import org.jooq.impl.UpdatableRecordImpl;
|
||||
|
||||
|
||||
/**
|
||||
* This class is generated by jOOQ.
|
||||
*/
|
||||
@Generated(
|
||||
value = {
|
||||
"http://www.jooq.org",
|
||||
"jOOQ version:3.11.12"
|
||||
},
|
||||
comments = "This class is generated by jOOQ"
|
||||
)
|
||||
@SuppressWarnings({"all", "unchecked", "rawtypes"})
|
||||
public class UserRecord extends UpdatableRecordImpl<UserRecord> implements Record2<UUID, String>
|
||||
{
|
||||
|
||||
private static final long serialVersionUID = 628808107;
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.USER.UNIQUEID</code>.
|
||||
*/
|
||||
public void setUniqueid(UUID value)
|
||||
{
|
||||
set(0, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.USER.UNIQUEID</code>.
|
||||
*/
|
||||
public UUID getUniqueid()
|
||||
{
|
||||
return (UUID) get(0);
|
||||
}
|
||||
|
||||
/**
|
||||
* Setter for <code>PUBLIC.USER.USERNAME</code>.
|
||||
*/
|
||||
public void setUsername(String value)
|
||||
{
|
||||
set(1, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Getter for <code>PUBLIC.USER.USERNAME</code>.
|
||||
*/
|
||||
public String getUsername()
|
||||
{
|
||||
return (String) get(1);
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Primary key information
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Record1<UUID> key()
|
||||
{
|
||||
return (Record1) super.key();
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Record2 type implementation
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row2<UUID, String> fieldsRow()
|
||||
{
|
||||
return (Row2) super.fieldsRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Row2<UUID, String> valuesRow()
|
||||
{
|
||||
return (Row2) super.valuesRow();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<UUID> field1()
|
||||
{
|
||||
return User.USER.UNIQUEID;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public Field<String> field2()
|
||||
{
|
||||
return User.USER.USERNAME;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID component1()
|
||||
{
|
||||
return getUniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String component2()
|
||||
{
|
||||
return getUsername();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UUID value1()
|
||||
{
|
||||
return getUniqueid();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public String value2()
|
||||
{
|
||||
return getUsername();
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UserRecord value1(UUID value)
|
||||
{
|
||||
setUniqueid(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UserRecord value2(String value)
|
||||
{
|
||||
setUsername(value);
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
@Override
|
||||
public UserRecord values(UUID value1, String value2)
|
||||
{
|
||||
value1(value1);
|
||||
value2(value2);
|
||||
return this;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------
|
||||
// Constructors
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* Create a detached UserRecord
|
||||
*/
|
||||
public UserRecord()
|
||||
{
|
||||
super(User.USER);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a detached, initialised UserRecord
|
||||
*/
|
||||
public UserRecord(UUID uniqueid, String username)
|
||||
{
|
||||
super(User.USER);
|
||||
|
||||
set(0, uniqueid);
|
||||
set(1, username);
|
||||
}
|
||||
}
|
||||
@@ -34,12 +34,11 @@ import com.google.common.collect.Multisets;
|
||||
import com.google.gson.reflect.TypeToken;
|
||||
import com.google.inject.Provides;
|
||||
import java.awt.image.BufferedImage;
|
||||
import java.io.BufferedWriter;
|
||||
import java.io.File;
|
||||
import java.io.FileNotFoundException;
|
||||
import java.io.FileReader;
|
||||
import java.io.IOException;
|
||||
import java.nio.file.Files;
|
||||
import java.sql.Timestamp;
|
||||
import java.time.Instant;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
@@ -51,6 +50,7 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Objects;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import java.util.concurrent.ScheduledExecutorService;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
@@ -93,6 +93,11 @@ import net.runelite.client.chat.ChatMessageBuilder;
|
||||
import net.runelite.client.chat.ChatMessageManager;
|
||||
import net.runelite.client.chat.QueuedMessage;
|
||||
import net.runelite.client.config.ConfigManager;
|
||||
import net.runelite.client.database.DatabaseManager;
|
||||
import static net.runelite.client.database.data.Tables.LOOTTRACKEREVENTS;
|
||||
import static net.runelite.client.database.data.Tables.LOOTTRACKERLINK;
|
||||
import static net.runelite.client.database.data.Tables.LOOTTRACKERLOOT;
|
||||
import static net.runelite.client.database.data.Tables.USER;
|
||||
import net.runelite.client.eventbus.EventBus;
|
||||
import net.runelite.client.events.NpcLootReceived;
|
||||
import net.runelite.client.events.PlayerLootReceived;
|
||||
@@ -117,6 +122,13 @@ import net.runelite.http.api.loottracker.LootRecord;
|
||||
import net.runelite.http.api.loottracker.LootRecordType;
|
||||
import net.runelite.http.api.loottracker.LootTrackerClient;
|
||||
import org.apache.commons.lang3.ArrayUtils;
|
||||
import org.jooq.DSLContext;
|
||||
import org.jooq.Record;
|
||||
import org.jooq.Record1;
|
||||
import org.jooq.Record2;
|
||||
import org.jooq.Result;
|
||||
import static org.jooq.impl.DSL.constraint;
|
||||
import org.jooq.impl.SQLDataType;
|
||||
|
||||
@PluginDescriptor(
|
||||
name = "Loot Tracker",
|
||||
@@ -177,7 +189,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
// Instant for showing session loot. this gets set on plugin startup
|
||||
|
||||
public static final Instant SESSION_START_TIME = Instant.now();
|
||||
static final Instant SESSION_START_TIME = Instant.now();
|
||||
|
||||
@Inject
|
||||
public Client client;
|
||||
@@ -208,6 +220,8 @@ public class LootTrackerPlugin extends Plugin
|
||||
private EventBus eventBus;
|
||||
@Inject
|
||||
private LootRecordWriter writer;
|
||||
@Inject
|
||||
private DatabaseManager databaseManager;
|
||||
private LootTrackerPanel panel;
|
||||
private NavigationButton navButton;
|
||||
private String eventType;
|
||||
@@ -221,6 +235,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
private Map<String, Integer> killCountMap = new HashMap<>();
|
||||
private boolean gotPet = false;
|
||||
private Map<String, UUID> userUuidMap = new HashMap<>();
|
||||
|
||||
private static Collection<ItemStack> stack(Collection<ItemStack> items)
|
||||
{
|
||||
@@ -331,6 +346,7 @@ public class LootTrackerPlugin extends Plugin
|
||||
@Override
|
||||
protected void startUp() throws Exception
|
||||
{
|
||||
initDatabase();
|
||||
|
||||
addSubscriptions();
|
||||
|
||||
@@ -352,8 +368,6 @@ public class LootTrackerPlugin extends Plugin
|
||||
clientToolbar.addNavigation(navButton);
|
||||
|
||||
AccountSession accountSession = sessionManager.getAccountSession();
|
||||
LOOT_RECORDS_FILE.createNewFile();
|
||||
// BufferedReader bufferedReader = Files.newBufferedReader(LOOT_RECORDS_FILE.toPath());
|
||||
if (accountSession != null || this.localPersistence)
|
||||
{
|
||||
|
||||
@@ -383,22 +397,60 @@ public class LootTrackerPlugin extends Plugin
|
||||
log.debug("Unable to look up loot", e);
|
||||
return;
|
||||
}
|
||||
log.debug("Loaded {} remote data entries", lootRecords.size());
|
||||
log.info("Loaded {} remote data entries", lootRecords.size());
|
||||
}
|
||||
|
||||
if (this.localPersistence)
|
||||
{
|
||||
try
|
||||
DSLContext dslContext = databaseManager.getDsl();
|
||||
|
||||
Result<Record> records = dslContext
|
||||
.selectDistinct(
|
||||
LOOTTRACKEREVENTS.UNIQUEID
|
||||
).select(
|
||||
LOOTTRACKEREVENTS.EVENTID,
|
||||
LOOTTRACKEREVENTS.TYPE,
|
||||
LOOTTRACKEREVENTS.TIME,
|
||||
USER.USERNAME
|
||||
)
|
||||
.from(LOOTTRACKEREVENTS)
|
||||
.join(LOOTTRACKERLINK).on(LOOTTRACKERLINK.EVENTUNIQUEID.eq(LOOTTRACKEREVENTS.UNIQUEID))
|
||||
.join(USER).on(LOOTTRACKERLINK.USERUNIQUEID.eq(USER.UNIQUEID))
|
||||
.fetch();
|
||||
|
||||
for (Record record : records)
|
||||
{
|
||||
lootRecords.addAll(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE),
|
||||
new TypeToken<ArrayList<LootRecord>>()
|
||||
{
|
||||
}.getType()));
|
||||
}
|
||||
catch (IOException | NullPointerException e)
|
||||
{
|
||||
log.info("Couldn't load any locally stored loots.");
|
||||
Result<Record2<Integer, Integer>> drops = dslContext
|
||||
.select(
|
||||
LOOTTRACKERLOOT.ITEMID,
|
||||
LOOTTRACKERLOOT.QUANTITY
|
||||
)
|
||||
.from(LOOTTRACKERLOOT)
|
||||
.join(LOOTTRACKERLINK).on(LOOTTRACKERLOOT.UNIQUEID.eq(LOOTTRACKERLINK.DROPUNIQUEID))
|
||||
.where(LOOTTRACKERLINK.EVENTUNIQUEID.eq(record.getValue(LOOTTRACKEREVENTS.UNIQUEID)))
|
||||
.fetch();
|
||||
|
||||
final List<GameItem> gameItems = new ArrayList<>();
|
||||
|
||||
for (Record drop : drops)
|
||||
{
|
||||
GameItem gameItem = new GameItem();
|
||||
gameItem.setId(drop.getValue(LOOTTRACKERLOOT.ITEMID));
|
||||
gameItem.setQty(drop.getValue(LOOTTRACKERLOOT.QUANTITY));
|
||||
|
||||
gameItems.add(gameItem);
|
||||
}
|
||||
|
||||
LootRecord lootRecord = new LootRecord();
|
||||
lootRecord.setEventId(record.getValue(LOOTTRACKEREVENTS.EVENTID));
|
||||
lootRecord.setUsername(record.getValue(USER.USERNAME));
|
||||
lootRecord.setType(record.getValue(LOOTTRACKEREVENTS.TYPE, LootRecordType.class));
|
||||
lootRecord.setDrops(gameItems);
|
||||
lootRecord.setTime(record.getValue(LOOTTRACKEREVENTS.TIME).toInstant());
|
||||
|
||||
lootRecords.add(lootRecord);
|
||||
}
|
||||
|
||||
if (lootRecords.size() > 0)
|
||||
{
|
||||
log.info("Loaded {} locally stored loot records", lootRecords.size());
|
||||
@@ -471,6 +523,8 @@ public class LootTrackerPlugin extends Plugin
|
||||
if (name != null)
|
||||
{
|
||||
writer.setPlayerUsername(name);
|
||||
userUuid(name);
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
@@ -685,12 +739,12 @@ public class LootTrackerPlugin extends Plugin
|
||||
|
||||
final LootTrackerItem[] entries = buildEntries(stack(items));
|
||||
|
||||
final int killCount = killCountMap.getOrDefault(eventType.toUpperCase(), -1);
|
||||
|
||||
SwingUtilities.invokeLater(() -> panel.add(eventType, client.getLocalPlayer().getName(), -1, entries));
|
||||
LootRecord lootRecord = new LootRecord(eventType, client.getLocalPlayer().getName(), LootRecordType.EVENT,
|
||||
toGameItems(items), Instant.now());
|
||||
|
||||
final int killCount = killCountMap.getOrDefault(eventType.toUpperCase(), -1);
|
||||
|
||||
if (lootTrackerClient != null && this.saveLoot)
|
||||
{
|
||||
lootTrackerClient.submit(lootRecord);
|
||||
@@ -929,42 +983,16 @@ public class LootTrackerPlugin extends Plugin
|
||||
private void saveLocalLootRecord(LootRecord lootRecord)
|
||||
{
|
||||
lootRecords.add(lootRecord);
|
||||
try
|
||||
{
|
||||
BufferedWriter bufferedWriter = Files.newBufferedWriter(LOOT_RECORDS_FILE.toPath());
|
||||
|
||||
bufferedWriter.append(RuneLiteAPI.GSON.toJson(lootRecords));
|
||||
bufferedWriter.close();
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
if (e instanceof FileNotFoundException)
|
||||
{
|
||||
try
|
||||
{
|
||||
LOOT_RECORDS_FILE.createNewFile();
|
||||
}
|
||||
catch (IOException ex)
|
||||
{
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
e.printStackTrace();
|
||||
}
|
||||
addLootRecord(databaseManager.getDsl(), lootRecord);
|
||||
}
|
||||
|
||||
void deleteLocalRecords()
|
||||
{
|
||||
try
|
||||
{
|
||||
lootRecords.clear();
|
||||
Files.deleteIfExists(LOOT_RECORDS_FILE.toPath());
|
||||
}
|
||||
catch (IOException e)
|
||||
{
|
||||
log.error("Error deleting local loot records file.");
|
||||
log.error(Arrays.toString(e.getStackTrace()));
|
||||
}
|
||||
lootRecords.clear();
|
||||
DSLContext dslContext = databaseManager.getDsl();
|
||||
dslContext.truncate(LOOTTRACKEREVENTS).execute();
|
||||
dslContext.truncate(LOOTTRACKERLOOT).execute();
|
||||
dslContext.truncate(LOOTTRACKERLINK).execute();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1232,4 +1260,182 @@ public class LootTrackerPlugin extends Plugin
|
||||
this.getBlacklist = config.getBlacklist();
|
||||
this.sendLootValueMessages = config.sendLootValueMessages();
|
||||
}
|
||||
|
||||
private void initDatabase()
|
||||
{
|
||||
boolean lootTrackerEvents = databaseManager.checkTableExists("LootTrackerEvents");
|
||||
boolean lootTrackerLoot = databaseManager.checkTableExists("LootTrackerLoot");
|
||||
boolean user = databaseManager.checkTableExists("User");
|
||||
boolean lootTrackerLink = databaseManager.checkTableExists("LootTrackerLink");
|
||||
|
||||
if (!lootTrackerEvents)
|
||||
{
|
||||
databaseManager.getDsl().createTable(LOOTTRACKEREVENTS)
|
||||
.column(LOOTTRACKEREVENTS.UNIQUEID, SQLDataType.UUID.nullable(false))
|
||||
.column(LOOTTRACKEREVENTS.EVENTID, SQLDataType.VARCHAR.length(255).nullable(false))
|
||||
.column(LOOTTRACKEREVENTS.TYPE, SQLDataType.VARCHAR.length(255).nullable(false))
|
||||
.column(LOOTTRACKEREVENTS.TIME, SQLDataType.TIMESTAMP(0).nullable(false))
|
||||
.constraints(
|
||||
constraint("PK_LOOTTRACKEREVENTS").primaryKey(LOOTTRACKEREVENTS.UNIQUEID)
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
if (!lootTrackerLoot)
|
||||
{
|
||||
databaseManager.getDsl().createTable(LOOTTRACKERLOOT)
|
||||
.column(LOOTTRACKERLOOT.UNIQUEID, SQLDataType.UUID.nullable(false))
|
||||
.column(LOOTTRACKERLOOT.ITEMID, SQLDataType.INTEGER.nullable(false))
|
||||
.column(LOOTTRACKERLOOT.QUANTITY, SQLDataType.INTEGER.nullable(false))
|
||||
.constraints(
|
||||
constraint("PK_LOOTTRACKERDROPS").primaryKey(LOOTTRACKERLOOT.UNIQUEID)
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
if (!user)
|
||||
{
|
||||
databaseManager.getDsl().createTable(USER)
|
||||
.column(USER.UNIQUEID, SQLDataType.UUID.nullable(false))
|
||||
.column(USER.USERNAME, SQLDataType.VARCHAR(12).nullable(false))
|
||||
.constraints(
|
||||
constraint("PK_USER").primaryKey(USER.UNIQUEID),
|
||||
constraint("UN_USERNAME").unique(USER.USERNAME)
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
if (!lootTrackerLink)
|
||||
{
|
||||
databaseManager.getDsl().createTable(LOOTTRACKERLINK)
|
||||
.column(LOOTTRACKERLINK.LINKUNIQUEID, SQLDataType.UUID.nullable(false))
|
||||
.column(LOOTTRACKERLINK.EVENTUNIQUEID, SQLDataType.UUID.nullable(false))
|
||||
.column(LOOTTRACKERLINK.DROPUNIQUEID, SQLDataType.UUID.nullable(false))
|
||||
.column(LOOTTRACKERLINK.USERUNIQUEID, SQLDataType.UUID.nullable(false))
|
||||
.constraints(
|
||||
constraint("FK_LOOTTRACKEREVENT").foreignKey(LOOTTRACKERLINK.EVENTUNIQUEID).references(LOOTTRACKEREVENTS, LOOTTRACKEREVENTS.UNIQUEID).onDeleteCascade().onUpdateCascade(),
|
||||
constraint("FK_LOOTTRACKERDROP").foreignKey(LOOTTRACKERLINK.DROPUNIQUEID).references(LOOTTRACKERLOOT, LOOTTRACKERLOOT.UNIQUEID).onDeleteCascade().onUpdateCascade(),
|
||||
constraint("FK_USER").foreignKey(LOOTTRACKERLINK.USERUNIQUEID).references(USER, USER.UNIQUEID).onDeleteCascade().onUpdateCascade()
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
|
||||
if (!lootTrackerEvents || !lootTrackerLoot || !lootTrackerLink || !user)
|
||||
{
|
||||
if (LOOT_RECORDS_FILE.exists())
|
||||
{
|
||||
migrateData();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void migrateData()
|
||||
{
|
||||
try
|
||||
{
|
||||
Collection<LootRecord> lootRecords = new ArrayList<>(RuneLiteAPI.GSON.fromJson(new FileReader(LOOT_RECORDS_FILE),
|
||||
new TypeToken<ArrayList<LootRecord>>()
|
||||
{
|
||||
}.getType()));
|
||||
|
||||
DSLContext dslContext = databaseManager.getDsl();
|
||||
|
||||
|
||||
for (LootRecord lootRecord : lootRecords)
|
||||
{
|
||||
addLootRecord(dslContext, lootRecord);
|
||||
}
|
||||
}
|
||||
catch (FileNotFoundException e)
|
||||
{
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private void addLootRecord(DSLContext dslContext, LootRecord lootRecord)
|
||||
{
|
||||
String username = lootRecord.getUsername();
|
||||
userUuid(username);
|
||||
|
||||
UUID eventUuid = UUID.randomUUID();
|
||||
dslContext
|
||||
.insertInto(
|
||||
LOOTTRACKEREVENTS,
|
||||
LOOTTRACKEREVENTS.UNIQUEID,
|
||||
LOOTTRACKEREVENTS.EVENTID,
|
||||
LOOTTRACKEREVENTS.TYPE,
|
||||
LOOTTRACKEREVENTS.TIME
|
||||
)
|
||||
.values(
|
||||
eventUuid,
|
||||
lootRecord.getEventId(),
|
||||
lootRecord.getType().toString(),
|
||||
Timestamp.from(lootRecord.getTime())
|
||||
)
|
||||
.execute();
|
||||
|
||||
for (GameItem item : lootRecord.getDrops())
|
||||
{
|
||||
UUID dropUuid = UUID.randomUUID();
|
||||
dslContext.
|
||||
insertInto(
|
||||
LOOTTRACKERLOOT,
|
||||
LOOTTRACKERLOOT.UNIQUEID,
|
||||
LOOTTRACKERLOOT.ITEMID,
|
||||
LOOTTRACKERLOOT.QUANTITY
|
||||
)
|
||||
.values(
|
||||
dropUuid,
|
||||
item.getId(),
|
||||
item.getQty()
|
||||
)
|
||||
.execute();
|
||||
|
||||
dslContext
|
||||
.insertInto(
|
||||
LOOTTRACKERLINK,
|
||||
LOOTTRACKERLINK.LINKUNIQUEID,
|
||||
LOOTTRACKERLINK.EVENTUNIQUEID,
|
||||
LOOTTRACKERLINK.DROPUNIQUEID,
|
||||
LOOTTRACKERLINK.USERUNIQUEID
|
||||
)
|
||||
.values(
|
||||
UUID.randomUUID(),
|
||||
eventUuid,
|
||||
dropUuid,
|
||||
userUuidMap.get(username)
|
||||
)
|
||||
.execute();
|
||||
}
|
||||
}
|
||||
|
||||
private void userUuid(String name)
|
||||
{
|
||||
if (userUuidMap.get(name) == null)
|
||||
{
|
||||
DSLContext dslContext = databaseManager.getDsl();
|
||||
|
||||
dslContext
|
||||
.insertInto(
|
||||
USER,
|
||||
USER.UNIQUEID,
|
||||
USER.USERNAME
|
||||
)
|
||||
.values(
|
||||
UUID.randomUUID(),
|
||||
name
|
||||
)
|
||||
.onConflict(USER.USERNAME)
|
||||
.doNothing()
|
||||
.execute();
|
||||
|
||||
Record1<UUID> user = dslContext
|
||||
.select(USER.UNIQUEID)
|
||||
.from(USER)
|
||||
.where(USER.USERNAME.eq(name))
|
||||
.fetchOne();
|
||||
|
||||
userUuidMap.put(name, user.get(USER.UNIQUEID));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user