diff --git a/src/main/java/emu/lunarcore/database/DatabaseManager.java b/src/main/java/emu/lunarcore/database/DatabaseManager.java index 834a63a..f381a1c 100644 --- a/src/main/java/emu/lunarcore/database/DatabaseManager.java +++ b/src/main/java/emu/lunarcore/database/DatabaseManager.java @@ -30,7 +30,9 @@ import emu.lunarcore.Config.InternalMongoInfo; import emu.lunarcore.LunarCore; import emu.lunarcore.LunarCore.ServerType; import emu.lunarcore.database.codecs.*; +import lombok.Getter; +@Getter public final class DatabaseManager { private MongoServer server; private Datastore datastore; @@ -99,18 +101,10 @@ public final class DatabaseManager { ensureIndexes(); } - public MongoServer getServer() { - return server; - } - public MongoDatabase getDatabase() { return getDatastore().getDatabase(); } - public Datastore getDatastore() { - return datastore; - } - private void ensureIndexes() { try { datastore.ensureIndexes(); @@ -129,7 +123,7 @@ public final class DatabaseManager { } } - // + // Internal mongo server public String startInternalMongoServer(InternalMongoInfo internalMongo) { // Get backend @@ -168,12 +162,12 @@ public final class DatabaseManager { return getDatastore().find(cls).filter(Filters.eq(filter, value)).first(); } - public T getObjectByField(Class cls, String filter, int value) { + public T getObjectByField(Class cls, String filter, long value) { return getDatastore().find(cls).filter(Filters.eq(filter, value)).first(); } - public Stream getObjects(Class cls, String filter, long uid) { - return getDatastore().find(cls).filter(Filters.eq(filter, uid)).stream(); + public Stream getObjects(Class cls, String filter, long value) { + return getDatastore().find(cls).filter(Filters.eq(filter, value)).stream(); } public Stream getObjects(Class cls) {