diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/RegisteredGenerators.java b/ap/src/main/java/org/geysermc/databaseutils/processor/RegisteredGenerators.java index 59816cd..c513457 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/RegisteredGenerators.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/RegisteredGenerators.java @@ -10,7 +10,7 @@ import java.util.Map; import java.util.function.Supplier; import java.util.stream.Collectors; -import org.geysermc.databaseutils.DatabaseType; +import org.geysermc.databaseutils.DatabaseCategory; import org.geysermc.databaseutils.processor.type.DatabaseGenerator; import org.geysermc.databaseutils.processor.type.RepositoryGenerator; import org.geysermc.databaseutils.processor.type.mongo.MongoDatabaseGenerator; @@ -19,8 +19,8 @@ import org.geysermc.databaseutils.processor.type.sql.SqlRepositoryGenerator; final class RegisteredGenerators { - private static final Map> DATABASE_GENERATORS = new HashMap<>(); - private static final Map> REPOSITORY_GENERATORS = new HashMap<>(); + private static final Map> DATABASE_GENERATORS = new HashMap<>(); + private static final Map> REPOSITORY_GENERATORS = new HashMap<>(); private RegisteredGenerators() {} @@ -38,10 +38,10 @@ public static int generatorCount() { static { // todo make it less cursed by using one map/list with everything for each database category - DATABASE_GENERATORS.put(DatabaseType.SQL, SqlDatabaseGenerator::new); - DATABASE_GENERATORS.put(DatabaseType.MONGODB, MongoDatabaseGenerator::new); + DATABASE_GENERATORS.put(DatabaseCategory.SQL, SqlDatabaseGenerator::new); + DATABASE_GENERATORS.put(DatabaseCategory.MONGODB, MongoDatabaseGenerator::new); - REPOSITORY_GENERATORS.put(DatabaseType.SQL, SqlRepositoryGenerator::new); - REPOSITORY_GENERATORS.put(DatabaseType.MONGODB, MongoRepositoryGenerator::new); + REPOSITORY_GENERATORS.put(DatabaseCategory.SQL, SqlRepositoryGenerator::new); + REPOSITORY_GENERATORS.put(DatabaseCategory.MONGODB, MongoRepositoryGenerator::new); } } diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/RepositoryProcessor.java b/ap/src/main/java/org/geysermc/databaseutils/processor/RepositoryProcessor.java index d24c10d..68822d0 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/RepositoryProcessor.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/RepositoryProcessor.java @@ -117,7 +117,7 @@ public boolean process(Set annotations, RoundEnvironment repositoryClasses.add(result.packageName() + "." + build.name); } - var spec = TypeSpec.classBuilder(generator.databaseType().upperCamelCaseName() + "DatabaseGenerated"); + var spec = TypeSpec.classBuilder(generator.databaseCategory().upperCamelCaseName() + "DatabaseGenerated"); generator.init(spec, hasAsync); generator.addEntities(entityManager.processedEntities()); generator.addRepositories(repositoryClasses); diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/type/DatabaseGenerator.java b/ap/src/main/java/org/geysermc/databaseutils/processor/type/DatabaseGenerator.java index 3284f43..f86c4af 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/type/DatabaseGenerator.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/type/DatabaseGenerator.java @@ -17,17 +17,17 @@ import java.util.List; import java.util.function.BiFunction; import javax.lang.model.element.Modifier; -import org.geysermc.databaseutils.DatabaseType; +import org.geysermc.databaseutils.DatabaseCategory; import org.geysermc.databaseutils.IRepository; import org.geysermc.databaseutils.codec.TypeCodecRegistry; import org.geysermc.databaseutils.processor.info.EntityInfo; public abstract class DatabaseGenerator { - private final DatabaseType databaseType; + private final DatabaseCategory databaseCategory; protected TypeSpec.Builder spec; - public DatabaseGenerator(DatabaseType databaseType) { - this.databaseType = databaseType; + public DatabaseGenerator(DatabaseCategory databaseCategory) { + this.databaseCategory = databaseCategory; } public void init(TypeSpec.Builder spec, boolean hasAsync) { @@ -40,8 +40,8 @@ public void init(TypeSpec.Builder spec, boolean hasAsync) { .build()); } - public DatabaseType databaseType() { - return databaseType; + public DatabaseCategory databaseCategory() { + return databaseCategory; } public abstract Class databaseClass(); diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/type/RepositoryGenerator.java b/ap/src/main/java/org/geysermc/databaseutils/processor/type/RepositoryGenerator.java index afbc137..4662fff 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/type/RepositoryGenerator.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/type/RepositoryGenerator.java @@ -12,7 +12,7 @@ import java.util.concurrent.CompletableFuture; import javax.lang.model.element.Modifier; import javax.lang.model.element.TypeElement; -import org.geysermc.databaseutils.DatabaseType; +import org.geysermc.databaseutils.DatabaseCategory; import org.geysermc.databaseutils.codec.TypeCodec; import org.geysermc.databaseutils.codec.TypeCodecRegistry; import org.geysermc.databaseutils.processor.info.ColumnInfo; @@ -21,15 +21,15 @@ import org.geysermc.databaseutils.processor.util.TypeUtils; public abstract class RepositoryGenerator { - private final DatabaseType type; + private final DatabaseCategory category; protected TypeSpec.Builder typeSpec; protected boolean hasAsync; protected EntityInfo entityInfo; private String packageName; - protected RepositoryGenerator(DatabaseType type) { - this.type = type; + protected RepositoryGenerator(DatabaseCategory category) { + this.category = category; } protected void onConstructorBuilder(MethodSpec.Builder builder) {} @@ -49,7 +49,7 @@ public void init(TypeElement superType, EntityInfo entityInfo) { throw new IllegalStateException("Cannot reinitialize RepositoryGenerator"); } this.packageName = TypeUtils.packageNameFor(superType.getQualifiedName()); - var className = superType.getSimpleName() + type.upperCamelCaseName() + "Impl"; + var className = superType.getSimpleName() + category.upperCamelCaseName() + "Impl"; this.typeSpec = TypeSpec.classBuilder(className) .addSuperinterface(ParameterizedTypeName.get(superType.asType())) .addModifiers(Modifier.PUBLIC, Modifier.FINAL); diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoDatabaseGenerator.java b/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoDatabaseGenerator.java index 7de2334..d9acfa4 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoDatabaseGenerator.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoDatabaseGenerator.java @@ -24,7 +24,7 @@ import org.bson.codecs.Codec; import org.bson.codecs.configuration.CodecProvider; import org.bson.codecs.configuration.CodecRegistry; -import org.geysermc.databaseutils.DatabaseType; +import org.geysermc.databaseutils.DatabaseCategory; import org.geysermc.databaseutils.meta.Index; import org.geysermc.databaseutils.mongo.MongodbDatabase; import org.geysermc.databaseutils.processor.info.EntityInfo; @@ -33,7 +33,7 @@ public class MongoDatabaseGenerator extends DatabaseGenerator { public MongoDatabaseGenerator() { - super(DatabaseType.MONGODB); + super(DatabaseCategory.MONGODB); } @Override diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoRepositoryGenerator.java b/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoRepositoryGenerator.java index e8603cf..98894c0 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoRepositoryGenerator.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/type/mongo/MongoRepositoryGenerator.java @@ -21,7 +21,7 @@ import javax.lang.model.element.Modifier; import org.bson.Document; import org.checkerframework.checker.nullness.qual.NonNull; -import org.geysermc.databaseutils.DatabaseType; +import org.geysermc.databaseutils.DatabaseCategory; import org.geysermc.databaseutils.processor.query.QueryContext; import org.geysermc.databaseutils.processor.query.section.by.keyword.EqualsKeyword; import org.geysermc.databaseutils.processor.query.section.by.keyword.LessThanKeyword; @@ -37,7 +37,7 @@ public class MongoRepositoryGenerator extends RepositoryGenerator { public MongoRepositoryGenerator() { - super(DatabaseType.MONGODB); + super(DatabaseCategory.MONGODB); } @Override diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlDatabaseGenerator.java b/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlDatabaseGenerator.java index 5786f91..786e8d7 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlDatabaseGenerator.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlDatabaseGenerator.java @@ -12,7 +12,7 @@ import java.sql.SQLException; import java.sql.Statement; import java.util.Collection; -import org.geysermc.databaseutils.DatabaseType; +import org.geysermc.databaseutils.DatabaseCategory; import org.geysermc.databaseutils.processor.info.ColumnInfo; import org.geysermc.databaseutils.processor.info.EntityInfo; import org.geysermc.databaseutils.processor.type.DatabaseGenerator; @@ -22,7 +22,7 @@ public class SqlDatabaseGenerator extends DatabaseGenerator { public SqlDatabaseGenerator() { - super(DatabaseType.SQL); + super(DatabaseCategory.SQL); } @Override diff --git a/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlRepositoryGenerator.java b/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlRepositoryGenerator.java index 27aa89b..f02968a 100644 --- a/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlRepositoryGenerator.java +++ b/ap/src/main/java/org/geysermc/databaseutils/processor/type/sql/SqlRepositoryGenerator.java @@ -21,7 +21,7 @@ import java.util.List; import java.util.concurrent.CompletionException; import javax.lang.model.element.Modifier; -import org.geysermc.databaseutils.DatabaseType; +import org.geysermc.databaseutils.DatabaseCategory; import org.geysermc.databaseutils.processor.info.ColumnInfo; import org.geysermc.databaseutils.processor.query.QueryContext; import org.geysermc.databaseutils.processor.query.section.by.keyword.EqualsKeyword; @@ -43,7 +43,7 @@ public final class SqlRepositoryGenerator extends RepositoryGenerator { private static final int BATCH_SIZE = 250; public SqlRepositoryGenerator() { - super(DatabaseType.SQL); + super(DatabaseCategory.SQL); } @Override diff --git a/core/src/main/java/org/geysermc/databaseutils/CredentialsFileHandler.java b/core/src/main/java/org/geysermc/databaseutils/CredentialsFileHandler.java index 9d8adf8..b9a9dcf 100644 --- a/core/src/main/java/org/geysermc/databaseutils/CredentialsFileHandler.java +++ b/core/src/main/java/org/geysermc/databaseutils/CredentialsFileHandler.java @@ -14,7 +14,7 @@ import java.util.Properties; final class CredentialsFileHandler { - public DatabaseConfig handle(DatabaseWithDialectType dialect, Path credentialsFile) { + public DatabaseConfig handle(DatabaseType dialect, Path credentialsFile) { DatabaseConfig config = defaultValuesFor(dialect); if (credentialsFile != null) { if (Files.exists(credentialsFile)) { @@ -55,7 +55,7 @@ private void createConfig(DatabaseConfig defaults, Path toStore) { } } - private DatabaseConfig defaultValuesFor(DatabaseWithDialectType type) { + private DatabaseConfig defaultValuesFor(DatabaseType type) { return switch (type) { case H2 -> configFor("jdbc:h2:./database", "sa"); case SQL_SERVER -> configFor("jdbc:sqlserver://localhost;encrypt=true;integratedSecurity=true;"); diff --git a/core/src/main/java/org/geysermc/databaseutils/DatabaseCategory.java b/core/src/main/java/org/geysermc/databaseutils/DatabaseCategory.java new file mode 100644 index 0000000..02f7ef8 --- /dev/null +++ b/core/src/main/java/org/geysermc/databaseutils/DatabaseCategory.java @@ -0,0 +1,21 @@ +/* + * Copyright (c) 2024 GeyserMC + * Licensed under the MIT license + * @link https://github.com/GeyserMC/DatabaseUtils + */ +package org.geysermc.databaseutils; + +public enum DatabaseCategory { + SQL("Sql"), + MONGODB("Mongo"); + + private final String upperCamelCaseName; + + DatabaseCategory(String upperCamelCaseName) { + this.upperCamelCaseName = upperCamelCaseName; + } + + public String upperCamelCaseName() { + return upperCamelCaseName; + } +} diff --git a/core/src/main/java/org/geysermc/databaseutils/DatabaseContext.java b/core/src/main/java/org/geysermc/databaseutils/DatabaseContext.java index 7b1d590..b09fbd0 100644 --- a/core/src/main/java/org/geysermc/databaseutils/DatabaseContext.java +++ b/core/src/main/java/org/geysermc/databaseutils/DatabaseContext.java @@ -33,7 +33,7 @@ public record DatabaseContext( String password, String poolName, int connectionPoolSize, - DatabaseWithDialectType type, + DatabaseType type, ExecutorService service, TypeCodecRegistry registry) { @@ -46,7 +46,7 @@ public record DatabaseContext( public DatabaseContext( DatabaseConfig config, String poolName, - DatabaseWithDialectType type, + DatabaseType type, ExecutorService service, TypeCodecRegistry registry) { this( diff --git a/core/src/main/java/org/geysermc/databaseutils/DatabaseLoader.java b/core/src/main/java/org/geysermc/databaseutils/DatabaseLoader.java index 679de0c..2d4b2cd 100644 --- a/core/src/main/java/org/geysermc/databaseutils/DatabaseLoader.java +++ b/core/src/main/java/org/geysermc/databaseutils/DatabaseLoader.java @@ -28,7 +28,7 @@ final class DatabaseLoader { List>> repositoryCreators; Method createEntitiesMethod; try { - var className = context.type().databaseType().upperCamelCaseName() + "DatabaseGenerated"; + var className = context.type().databaseCategory().upperCamelCaseName() + "DatabaseGenerated"; databaseImplClass = Class.forName(database.getClass().getPackageName() + "." + className); hasAsync = access(databaseImplClass.getDeclaredField("HAS_ASYNC")).getBoolean(null); diff --git a/core/src/main/java/org/geysermc/databaseutils/DatabaseRegistry.java b/core/src/main/java/org/geysermc/databaseutils/DatabaseRegistry.java index 8ec1121..10ea3e0 100644 --- a/core/src/main/java/org/geysermc/databaseutils/DatabaseRegistry.java +++ b/core/src/main/java/org/geysermc/databaseutils/DatabaseRegistry.java @@ -13,11 +13,11 @@ import org.geysermc.databaseutils.sql.SqlDatabase; final class DatabaseRegistry { - private static final Map> TYPES = - Map.of(DatabaseType.SQL, SqlDatabase::new, DatabaseType.MONGODB, MongodbDatabase::new); + private static final Map> TYPES = + Map.of(DatabaseCategory.SQL, SqlDatabase::new, DatabaseCategory.MONGODB, MongodbDatabase::new); - public static @Nullable Database databaseFor(@NonNull DatabaseWithDialectType type) { - var instanceSupplier = TYPES.get(type.databaseType()); + public static @Nullable Database databaseFor(@NonNull DatabaseType type) { + var instanceSupplier = TYPES.get(type.databaseCategory()); if (instanceSupplier == null) { return null; } diff --git a/core/src/main/java/org/geysermc/databaseutils/DatabaseType.java b/core/src/main/java/org/geysermc/databaseutils/DatabaseType.java index 3633b84..eaad8e3 100644 --- a/core/src/main/java/org/geysermc/databaseutils/DatabaseType.java +++ b/core/src/main/java/org/geysermc/databaseutils/DatabaseType.java @@ -1,21 +1,69 @@ /* - * Copyright (c) 2024 GeyserMC - * Licensed under the MIT license + * Copyright (c) 2024 GeyserMC + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN + * THE SOFTWARE. + * + * @author GeyserMC * @link https://github.com/GeyserMC/DatabaseUtils */ package org.geysermc.databaseutils; +import java.util.Locale; +import java.util.Objects; +import org.checkerframework.checker.nullness.qual.NonNull; +import org.checkerframework.checker.nullness.qual.Nullable; +import org.geysermc.databaseutils.sql.SqlDialect; + public enum DatabaseType { - SQL("Sql"), - MONGODB("Mongo"); + H2(DatabaseCategory.SQL, SqlDialect.H2), + SQL_SERVER(DatabaseCategory.SQL, SqlDialect.SQL_SERVER), + MYSQL(DatabaseCategory.SQL, SqlDialect.MYSQL), + ORACLE_DATABASE(DatabaseCategory.SQL, SqlDialect.ORACLE_DATABASE), + POSTGRESQL(DatabaseCategory.SQL, SqlDialect.POSTGRESQL), + SQLITE(DatabaseCategory.SQL, SqlDialect.SQLITE), + MONGODB(DatabaseCategory.MONGODB, null); + + private static final DatabaseType[] VALUES = values(); + + private final DatabaseCategory databaseCategory; + private final SqlDialect dialect; - private final String upperCamelCaseName; + DatabaseType(@NonNull DatabaseCategory databaseCategory, @Nullable SqlDialect dialect) { + this.databaseCategory = Objects.requireNonNull(databaseCategory); + this.dialect = dialect; + } + + public static @Nullable DatabaseType byName(@NonNull String name) { + var normalized = name.replace('-', '_').replace(' ', '_').toUpperCase(Locale.ROOT); + for (DatabaseType value : VALUES) { + if (value.name().equals(normalized)) { + return value; + } + } + return null; + } - DatabaseType(String upperCamelCaseName) { - this.upperCamelCaseName = upperCamelCaseName; + public @NonNull DatabaseCategory databaseCategory() { + return databaseCategory; } - public String upperCamelCaseName() { - return upperCamelCaseName; + public @Nullable SqlDialect dialect() { + return dialect; } } diff --git a/core/src/main/java/org/geysermc/databaseutils/DatabaseUtils.java b/core/src/main/java/org/geysermc/databaseutils/DatabaseUtils.java index 4f671cd..f44b4cd 100644 --- a/core/src/main/java/org/geysermc/databaseutils/DatabaseUtils.java +++ b/core/src/main/java/org/geysermc/databaseutils/DatabaseUtils.java @@ -81,7 +81,7 @@ public static class Builder { private String poolName = "database-utils"; private int connectionPoolSize = 0; - private DatabaseWithDialectType type; + private DatabaseType type; private Path credentialsFile; private boolean useDefaultCredentials = true; @@ -158,11 +158,11 @@ public Builder connectionPoolSize(int connectionPoolSize) { return this; } - public DatabaseWithDialectType type() { + public DatabaseType type() { return type; } - public Builder type(DatabaseWithDialectType type) { + public Builder type(DatabaseType type) { this.type = type; return this; } diff --git a/core/src/main/java/org/geysermc/databaseutils/DatabaseWithDialectType.java b/core/src/main/java/org/geysermc/databaseutils/DatabaseWithDialectType.java deleted file mode 100644 index 2742151..0000000 --- a/core/src/main/java/org/geysermc/databaseutils/DatabaseWithDialectType.java +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2024 GeyserMC - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - * @author GeyserMC - * @link https://github.com/GeyserMC/DatabaseUtils - */ -package org.geysermc.databaseutils; - -import java.util.Locale; -import java.util.Objects; -import org.checkerframework.checker.nullness.qual.NonNull; -import org.checkerframework.checker.nullness.qual.Nullable; -import org.geysermc.databaseutils.sql.SqlDialect; - -public enum DatabaseWithDialectType { - H2(DatabaseType.SQL, SqlDialect.H2), - SQL_SERVER(DatabaseType.SQL, SqlDialect.SQL_SERVER), - MYSQL(DatabaseType.SQL, SqlDialect.MYSQL), - ORACLE_DATABASE(DatabaseType.SQL, SqlDialect.ORACLE_DATABASE), - POSTGRESQL(DatabaseType.SQL, SqlDialect.POSTGRESQL), - SQLITE(DatabaseType.SQL, SqlDialect.SQLITE), - MONGODB(DatabaseType.MONGODB, null); - - private static final DatabaseWithDialectType[] VALUES = values(); - - private final DatabaseType databaseType; - private final SqlDialect dialect; - - DatabaseWithDialectType(@NonNull DatabaseType databaseType, @Nullable SqlDialect dialect) { - this.databaseType = Objects.requireNonNull(databaseType); - this.dialect = dialect; - } - - public static @Nullable DatabaseWithDialectType byName(@NonNull String name) { - var normalized = name.replace('-', '_').replace(' ', '_').toUpperCase(Locale.ROOT); - for (DatabaseWithDialectType value : VALUES) { - if (value.name().equals(normalized)) { - return value; - } - } - return null; - } - - public @NonNull DatabaseType databaseType() { - return databaseType; - } - - public @Nullable SqlDialect dialect() { - return dialect; - } -} diff --git a/core/src/test/java/org/geysermc/databaseutils/SqlTest.java b/core/src/test/java/org/geysermc/databaseutils/SqlTest.java index 87638d1..38dac8d 100644 --- a/core/src/test/java/org/geysermc/databaseutils/SqlTest.java +++ b/core/src/test/java/org/geysermc/databaseutils/SqlTest.java @@ -17,7 +17,7 @@ final class SqlTest { void hello() throws ExecutionException, InterruptedException { var utils = DatabaseUtils.builder() .useDefaultCredentials(true) - .type(DatabaseWithDialectType.MONGODB) + .type(DatabaseType.H2) .executorService(Executors.newCachedThreadPool()) .build();