| Package | Description |
|---|---|
| net.pterodactylus.util.database |
Helper and abstraction classes for database interaction.
|
| Modifier and Type | Method and Description |
|---|---|
static <D extends DataObject<D>> |
DataObject.create(Database database,
DataObjectFactory<D> dataObjectFactory,
ValueField... valueFields)
Creates a new data object with the given value fields.
|
boolean |
DataObject.delete(Database database)
Deletes this data object from the database.
|
static <D extends DataObject<D>> |
DataObject.deleteById(Database database,
DataObjectFactory<D> dataObjectFactory,
long id)
Deletes the data object with the given ID from the database.
|
static <D extends DataObject<D>> |
DataObject.deleteByWhereClause(Database database,
DataObjectFactory<D> dataObjectFactory,
WhereClause whereClause)
Deletes all objects from the database that match the given WHERE clause.
|
<T> List<T> |
Database.getMultiple(Query query,
ObjectCreator<T> objectCreator)
Returns multiple query results.
|
<T> List<T> |
AbstractDatabase.getMultiple(Query query,
ObjectCreator<T> objectCreator) |
<T> T |
Database.getSingle(Query query,
ObjectCreator<T> objectCreator)
Returns a single object from a database.
|
<T> T |
AbstractDatabase.getSingle(Query query,
ObjectCreator<T> objectCreator) |
long |
Database.insert(Query query)
Inserts an object into the database and returns the automatically
generated ID, if any.
|
long |
AbstractDatabase.insert(Query query) |
static <D extends DataObject<D>> |
DataObject.loadAllByWhereClause(Database database,
DataObjectFactory<D> dataObjectFactory,
WhereClause whereClause,
OrderField... orderFields)
Loads all data objects that match the given where clause from the given
database.
|
static <D extends DataObject<D>> |
DataObject.loadById(Database database,
DataObjectFactory<D> dataObjectFactory,
long id)
Loads a data object from the given database by the given ID.
|
static <D extends DataObject<D>> |
DataObject.loadByWhereClause(Database database,
DataObjectFactory<D> dataObjectFactory,
WhereClause whereClause,
OrderField... orderFields)
Loads the first data object that matches the given where clause from the
given database.
|
void |
Database.process(Query query,
ResultProcessor resultProcessor)
Processes the results of the given query with the given result processor.
|
void |
AbstractDatabase.process(Query query,
ResultProcessor resultProcessor)
Processes the results of the given query with the given result processor.
|
void |
DataObject.save(Database database)
Saves this data object to the database if it is dirty.
|
void |
DataObject.save(Database database,
boolean force)
Saves this data object to the database if it is dirty, or if the
force parameter is true. |
int |
Database.update(Query query)
Updates objects in the database.
|
int |
AbstractDatabase.update(Query query) |
Copyright © 2026. All rights reserved.