DataStore.StorageTypevalueSeparator| Constructor and Description |
|---|
MySQL(net.lapismc.lapiscore.LapisCorePlugin core,
LapisURL url,
String username,
String password) |
| Modifier and Type | Method and Description |
|---|---|
void |
addData(Table table,
String values)
Add data to a table, this may result in duplicate values
|
void |
addData(Table table,
String primaryKey,
String primaryValue,
String values)
Add or update data in a table, if used properly this will ensure that there are no duplicate
rows and allows mass value updating
|
void |
closeConnection()
Closes any currently open connections to the database
|
void |
createDatabase() |
abstract void |
createTables(Connection conn) |
protected void |
dropTable(Table table)
Drop an entire table
|
Boolean |
getBoolean(Table table,
String primaryKey,
String value,
String key)
Get a value of the type Boolean
|
List<String> |
getEntireColumn(Table table,
String key)
Get all the values in a column of a table
|
List<String> |
getEntireRow(Table table,
String primaryKey,
String value)
Returns a list of String that contains all the values in a row that matches the primary key and value
|
List<String> |
getEntireTable(Table table)
Get a list of all rows in a table, the values are separated with
DataStore.valueSeparator |
Long |
getLong(Table table,
String primaryKey,
String value,
String key)
Get a value of the type Long
|
List<Long> |
getLongList(Table table,
String primaryKey,
String value,
String key)
Get a list of long, use a non unique primary key and value to get multiple values returned
|
Object |
getObject(Table table,
String primaryKey,
String value,
String key)
Get a value of the type Object
|
DataStore.StorageType |
getStorageType()
Get the storage type
|
String |
getString(Table table,
String primaryKey,
String value,
String key)
Get a value of the type String
|
List<String> |
getStringList(Table table,
String primaryKey,
String value,
String key)
Get a list of strings, use a non unique primary key and value to get multiple values returned
|
void |
initialiseDataStore()
This will create and necessary files and generate tables
|
void |
removeAllData(Table table)
Removes all rows from the given table
|
void |
removeData(Table table,
String key,
String value)
Removes any row with value in the key column in table
|
void |
setData(Table table,
String primaryKey,
String primaryValue,
String key,
String value)
Set a single value in a row
|
void |
shutdown()
Shutdown will close any connections and shutdown the connection manager
|
convertData, isAsync, setAsyncpublic void initialiseDataStore()
DataStoreinitialiseDataStore in class DataStorepublic DataStore.StorageType getStorageType()
DataStoregetStorageType in class DataStorepublic void closeConnection()
DataStorecloseConnection in class DataStorepublic void shutdown()
DataStorepublic void createDatabase()
public void addData(Table table, String primaryKey, String primaryValue, String values)
DataStoreaddData in class DataStoretable - The table you wish to editprimaryKey - The primary key of this tableprimaryValue - The value you wish to add/edit for in the primary key columnvalues - The values you wish to add, must be in the correct order based on the table definition and be
separated by the DataStore.valueSeparator, Must include all values of the tablepublic void addData(Table table, String values)
DataStoreaddData in class DataStoretable - The table you wish to add toovalues - The values you wish to add, must be in the correct order based on the table definition and be
separated by the DataStore.valueSeparator, Must include all values of the tablepublic void setData(Table table, String primaryKey, String primaryValue, String key, String value)
DataStoresetData in class DataStoretable - The table you wish to editprimaryKey - The primary key of the row you wish to editprimaryValue - The primary keys value for the row you wish to editkey - The key of the value you wish to editvalue - The value you wish the key to be set toopublic Long getLong(Table table, String primaryKey, String value, String key)
DataStoregetLong in class DataStoretable - The table you wish to accessprimaryKey - The primary key of the row you wish to accessvalue - The value of the primary key in the row you wish to accesskey - The key to the value you wish to accesspublic String getString(Table table, String primaryKey, String value, String key)
DataStoregetString in class DataStoretable - The table you wish to accessprimaryKey - The primary key of the row you wish to accessvalue - The value of the primary key in the row you wish to accesskey - The key to the value you wish to accesspublic Boolean getBoolean(Table table, String primaryKey, String value, String key)
DataStoregetBoolean in class DataStoretable - The table you wish to accessprimaryKey - The primary key of the row you wish to accessvalue - The value of the primary key in the row you wish to accesskey - The key to the value you wish to accesspublic Object getObject(Table table, String primaryKey, String value, String key)
DataStoregetObject in class DataStoretable - The table you wish to accessprimaryKey - The primary key of the row you wish to accessvalue - The value of the primary key in the row you wish to accesskey - The key to the value you wish to accesspublic List<Long> getLongList(Table table, String primaryKey, String value, String key)
DataStoregetLongList in class DataStoretable - The table you wish to accessprimaryKey - The primary key of the row you wish to accessvalue - The value of the primary key in the row you wish to accesskey - The key to the value you wish to accesspublic List<String> getStringList(Table table, String primaryKey, String value, String key)
DataStoregetStringList in class DataStoretable - The table you wish to accessprimaryKey - The primary key of the row you wish to accessvalue - The value of the primary key in the row you wish to accesskey - The key to the value you wish to accesspublic List<String> getEntireColumn(Table table, String key)
DataStoregetEntireColumn in class DataStoretable - The table you wish to accesskey - The column you wish to receive values frompublic List<String> getEntireRow(Table table, String primaryKey, String value)
DataStoregetEntireRow in class DataStoretable - The table you wish to accessprimaryKey - The primary value of the row you wish to accessvalue - The value of the primary key in the row you wish to accesspublic void removeData(Table table, String key, String value)
DataStoreremoveData in class DataStoretable - The table you wish to editkey - The key you wish to test forvalue - The value required for a record to be deletedpublic void removeAllData(Table table)
DataStoreremoveAllData in class DataStoretable - the table to truncateprotected void dropTable(Table table)
DataStorepublic List<String> getEntireTable(Table table)
DataStoreDataStore.valueSeparatorgetEntireTable in class DataStoretable - The table you wish to retrievepublic abstract void createTables(Connection conn)
Copyright © 2020. All rights reserved.