Minor code smells/javadoc fixes in database code

This commit is contained in:
Florian CUNY 2019-07-04 13:47:48 +02:00
parent 9fdf320fdf
commit 45c78fc7f2
2 changed files with 3 additions and 2 deletions

View File

@ -19,7 +19,7 @@ public interface DatabaseSetup {
/**
* Gets the type of database being used.
* Currently supported options are YAML, JSON, MYSQL, MARIADB and MONGODB.
* Default is YAML.
* Default is JSON.
* @return Database type
*/
static DatabaseSetup getDatabase() {

View File

@ -18,6 +18,7 @@ import org.bukkit.scheduler.BukkitTask;
import com.google.gson.Gson;
import com.google.gson.JsonSyntaxException;
import org.eclipse.jdt.annotation.NonNull;
import world.bentobox.bentobox.BentoBox;
import world.bentobox.bentobox.database.DatabaseConnector;
import world.bentobox.bentobox.database.json.AbstractJSONDatabaseHandler;
@ -149,7 +150,7 @@ public class MySQLDatabaseHandler<T> extends AbstractJSONDatabaseHandler<T> {
}
@Override
public T loadObject(String uniqueId) {
public T loadObject(@NonNull String uniqueId) {
String sb = "SELECT `json` FROM `" + dataObject.getCanonicalName() + "` WHERE uniqueId = ? LIMIT 1";
try (PreparedStatement preparedStatement = connection.prepareStatement(sb)) {
// UniqueId needs to be placed in quotes