From c4f533c64419ed065086ead2e23253704a865d45 Mon Sep 17 00:00:00 2001 From: Marco Wolf Date: Wed, 3 Jul 2024 16:13:16 +0200 Subject: [PATCH] Couchbase collection support Add collection as additional definition to database information --- .../java/com/schwarz/crystalapi/Entity.java | 2 + .../schwarz/crystalapi/PersistenceConfig.kt | 24 ++++++-- crystal-map-couchbase-connector/build.gradle | 2 +- .../Couchbase2Connector.kt | 56 ++++++++++++++----- .../model/CommonInterfaceGeneration.kt | 11 +++- .../generation/model/EntityGeneration.kt | 41 ++++++++++---- .../generation/model/WrapperGeneration.kt | 20 ++++++- .../crystalprocessor/model/EntityFactory.kt | 1 + .../model/entity/EntityHolder.kt | 15 ++++- .../model/field/CblBaseFieldHolder.kt | 2 + .../model/field/CblConstantHolder.kt | 2 + .../model/field/CblFieldHolder.kt | 2 + .../model/query/CblQueryHolder.kt | 4 +- .../util/JavaAnnotationUtil.java | 3 + .../kaufland/com/demo/UnitTestConnector.kt | 2 +- 15 files changed, 151 insertions(+), 36 deletions(-) diff --git a/crystal-map-api/src/main/java/com/schwarz/crystalapi/Entity.java b/crystal-map-api/src/main/java/com/schwarz/crystalapi/Entity.java index 65db27f4..bd11513b 100644 --- a/crystal-map-api/src/main/java/com/schwarz/crystalapi/Entity.java +++ b/crystal-map-api/src/main/java/com/schwarz/crystalapi/Entity.java @@ -22,4 +22,6 @@ enum Type { Type type() default Type.READ_AND_WRITE; String database() default ""; + + String collection() default ""; } diff --git a/crystal-map-api/src/main/java/com/schwarz/crystalapi/PersistenceConfig.kt b/crystal-map-api/src/main/java/com/schwarz/crystalapi/PersistenceConfig.kt index 8a834354..9076a41e 100644 --- a/crystal-map-api/src/main/java/com/schwarz/crystalapi/PersistenceConfig.kt +++ b/crystal-map-api/src/main/java/com/schwarz/crystalapi/PersistenceConfig.kt @@ -8,30 +8,38 @@ object PersistenceConfig { fun getDocument( id: String, dbName: String, + collection: String = "", onlyInclude: List? = null ): Map? fun getDocuments( ids: List, dbName: String, + collection: String = "", onlyInclude: List? = null ): List?> fun queryDoc( dbName: String, + collection: String = "", queryParams: Map, limit: Int? = null, onlyInclude: List? = null ): List> @Throws(PersistenceException::class) - fun deleteDocument(id: String, dbName: String) + fun deleteDocument( + id: String, + dbName: String, + collection: String = "" + ) @Throws(PersistenceException::class) fun upsertDocument( document: MutableMap, id: String?, - dbName: String + dbName: String, + collection: String = "" ): Map } @@ -40,30 +48,38 @@ object PersistenceConfig { suspend fun getDocument( id: String, dbName: String, + collection: String = "", onlyInclude: List? = null ): Map? suspend fun getDocuments( ids: List, dbName: String, + collection: String = "", onlyInclude: List? = null ): List> suspend fun queryDoc( dbName: String, + collection: String = "", queryParams: Map, limit: Int? = null, onlyInclude: List? = null ): List> @Throws(PersistenceException::class) - suspend fun deleteDocument(id: String, dbName: String) + suspend fun deleteDocument( + id: String, + dbName: String, + collection: String = "" + ) @Throws(PersistenceException::class) suspend fun upsertDocument( document: MutableMap, id: String?, - dbName: String + dbName: String, + collection: String = "" ): Map } diff --git a/crystal-map-couchbase-connector/build.gradle b/crystal-map-couchbase-connector/build.gradle index 27cf058f..032b7892 100644 --- a/crystal-map-couchbase-connector/build.gradle +++ b/crystal-map-couchbase-connector/build.gradle @@ -49,7 +49,7 @@ dependencies { testImplementation 'junit:junit:4.12' androidTestImplementation 'androidx.test.ext:junit:1.1.1' androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0' - compileOnly 'com.couchbase.lite:couchbase-lite-android:2.1.2' + compileOnly 'com.couchbase.lite:couchbase-lite-android:3.1.8' implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version" implementation project(path: ':crystal-map-api') } diff --git a/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt b/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt index cca37ba4..652b233b 100644 --- a/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt +++ b/crystal-map-couchbase-connector/src/main/java/com/schwarz/crystalcouchbaseconnector/Couchbase2Connector.kt @@ -3,6 +3,7 @@ package com.schwarz.crystalcouchbaseconnector import com.couchbase.lite.* import com.schwarz.crystalapi.PersistenceConfig import com.schwarz.crystalapi.PersistenceException +import java.lang.IllegalStateException import java.util.* import kotlin.jvm.Throws @@ -10,8 +11,8 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { protected abstract fun getDatabase(name: String): Database - override fun getDocument(id: String, dbName: String, onlyInclude: List?): Map? { - val document = getDatabase(dbName).getDocument(id) ?: return null + override fun getDocument(id: String, dbName: String, collection: String, onlyInclude: List?): Map? { + val document = getDocument(id, dbName, collection) ?: return null val result = document.toMap() result["_id"] = id @@ -21,18 +22,23 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { override fun getDocuments( ids: List, dbName: String, + collection: String, onlyInclude: List? ): List?> = ids.mapNotNull { docId -> - getDocument(docId, dbName) + getDocument(docId, dbName, collection, null) } @Throws(PersistenceException::class) - override fun deleteDocument(id: String, dbName: String) { + override fun deleteDocument(id: String, dbName: String, collection: String) { try { - val document = getDatabase(dbName).getDocument(id) + val document = getDocument(id, dbName, collection) if (document != null) { - getDatabase(dbName).delete(document) + if (collection.isEmpty()) { + getDatabase(dbName).delete(document) + } else { + getDatabase(dbName).getCollection(collection)?.delete(document) + } } } catch (e: CouchbaseLiteException) { throw PersistenceException(e) @@ -42,13 +48,24 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { @Throws(PersistenceException::class) override fun queryDoc( dbName: String, + collection: String, queryParams: Map, limit: Int?, onlyInclude: List? ): List> { try { - val builder = QueryBuilder.select(SelectResult.expression(Meta.id), SelectResult.all()) - .from(DataSource.database(getDatabase(dbName))) + val builder = QueryBuilder.select(SelectResult.expression(Meta.id), SelectResult.all()).let { select -> + if (collection.isEmpty()) { + select.from(DataSource.database(getDatabase(dbName))) + } else { + select.from( + DataSource.collection( + getDatabase(dbName).getCollection(collection) + ?: throw IllegalStateException("Collection $collection not found for db $dbName") + ) + ) + } + } parseExpressions(queryParams)?.let { builder.where(it) @@ -67,10 +84,9 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { ArrayList() if (execute != null) { for (result in execute) { - val item: MutableMap = - HashMap() - item["_id"] = result.getString(0) - item.putAll(result.getDictionary(1).toMap()) + val item: MutableMap = mutableMapOf() + item["_id"] = result.getString(0).orEmpty() + item.putAll(result.getDictionary(1)?.toMap() ?: emptyMap()) parsed.add(item) } } @@ -95,7 +111,7 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { } @Throws(PersistenceException::class) - override fun upsertDocument(document: MutableMap, id: String?, dbName: String): Map { + override fun upsertDocument(document: MutableMap, id: String?, dbName: String, collection: String): Map { if (document["_id"] == null && id != null) { document["_id"] = id } @@ -103,10 +119,22 @@ abstract class Couchbase2Connector : PersistenceConfig.Connector { return try { document["_id"] = unsavedDoc.id unsavedDoc.setString("_id", unsavedDoc.id) - getDatabase(dbName).save(unsavedDoc) + if (collection.isEmpty()) { + getDatabase(dbName).save(unsavedDoc) + } else { + getDatabase(dbName).getCollection(collection)?.save(unsavedDoc) + ?: throw IllegalStateException("Collection $collection not found for db $dbName") + } document } catch (e: CouchbaseLiteException) { throw PersistenceException(e) } } + + private fun getDocument(id: String, dbName: String, collection: String): Document? = + if (collection.isEmpty()) { + getDatabase(dbName).getDocument(id) ?: null + } else { + getDatabase(dbName).getCollection(collection)?.getDocument(id) ?: null + } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt index dde0cbb9..8c7f0b3f 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/CommonInterfaceGeneration.kt @@ -63,7 +63,16 @@ class CommonInterfaceGeneration { } for (fieldHolder in holder.allFields) { - typeBuilder.addProperty(fieldHolder.property(null, holder.abstractParts, false, holder.deprecated, typeConvertersByConvertedClass)) + typeBuilder.addProperty( + fieldHolder.property( + dbName = null, + collection = null, + holder.abstractParts, + useMDocChanges = false, + holder.deprecated, + typeConvertersByConvertedClass + ) + ) } val companionSpec = TypeSpec.companionObjectBuilder() diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt index 551037bf..2fec8faf 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/EntityGeneration.kt @@ -46,7 +46,13 @@ class EntityGeneration { companionSpec.addFunction(findByIds(holder, useSuspend)) for (query in holder.queries) { - query.queryFun(holder.dbName, holder, useSuspend, typeConvertersByConvertedClass).let { + query.queryFun( + holder.dbName, + holder.collection, + holder, + useSuspend, + typeConvertersByConvertedClass + ).let { companionSpec.addFunction(it) } } @@ -68,6 +74,7 @@ class EntityGeneration { .addSuperinterface(holder.interfaceTypeName) .addSuperinterface(MandatoryCheck::class) .addProperty(holder.dbNameProperty()) + .addProperty(holder.collectionProperty()) .addFunction(EnsureTypesGeneration.ensureTypes(holder, false, typeConvertersByConvertedClass)) .addFunction(CblDefaultGeneration.addDefaults(holder, false)) .addFunction(CblConstantGeneration.addConstants(holder, false)) @@ -111,6 +118,7 @@ class EntityGeneration { for (fieldHolder in holder.allFields) { fieldHolder.builderSetter( holder.dbName, + holder.collection, holder.sourcePackage, holder.entitySimpleName, true, @@ -123,6 +131,7 @@ class EntityGeneration { typeBuilder.addProperty( fieldHolder.property( holder.dbName, + holder.collection, holder.abstractParts, true, holder.deprecated, @@ -155,9 +164,10 @@ class EntityGeneration { builder.addStatement("throw %T()", UnsupportedOperationException::class) } else { builder.addStatement( - "val result = %T.${getDocumentMethod(useSuspend)}(id, %S, %N)", + "val result = %T.${getDocumentMethod(useSuspend)}(id, %S, %S, %N)", PersistenceConfig::class, holder.dbName, + holder.collection, CblReduceGeneration.PROPERTY_ONLY_INCLUDES ) .addStatement( @@ -178,9 +188,10 @@ class EntityGeneration { builder.addStatement("throw %T()", UnsupportedOperationException::class) } else { builder.addStatement( - "val result = %T.${getDocumentsMethod(useSuspend)}(ids, %S, %N)", + "val result = %T.${getDocumentsMethod(useSuspend)}(ids, %S, %S, %N)", PersistenceConfig::class, holder.dbName, + holder.collection, CblReduceGeneration.PROPERTY_ONLY_INCLUDES ) .addStatement( @@ -197,7 +208,7 @@ class EntityGeneration { } private fun toMap(holder: EntityHolder, useSuspend: Boolean): FunSpec { - var refreshDoc = "getId()?.let{%T.${getDocumentMethod(useSuspend)}(it, %S)} ?: mDoc" + var refreshDoc = "getId()?.let{%T.${getDocumentMethod(useSuspend)}(it, %S, %S)} ?: mDoc" if (useSuspend) { refreshDoc = "kotlinx.coroutines.runBlocking{$refreshDoc}" @@ -205,7 +216,12 @@ class EntityGeneration { val toMapBuilder = FunSpec.builder("toMap").addModifiers(KModifier.OVERRIDE) .returns(TypeUtil.mutableMapStringAny()) - .addStatement("val doc = $refreshDoc", PersistenceConfig::class, holder.dbName) + .addStatement( + "val doc = $refreshDoc", + PersistenceConfig::class, + holder.dbName, + holder.collection + ) for (constantField in holder.fieldConstants.values) { toMapBuilder.addStatement( @@ -248,9 +264,10 @@ class EntityGeneration { builder.addStatement("throw %T()", UnsupportedOperationException::class) } else { builder.addStatement( - "getId()?.let{%T.${deleteDocumentMethod(useSuspend)}(it, %S)}", + "getId()?.let{%T.${deleteDocumentMethod(useSuspend)}(it, %S, %S)}", PersistenceConfig::class, - holder.dbName + holder.dbName, + holder.collection ) } return builder.build() @@ -279,9 +296,10 @@ class EntityGeneration { saveBuilder.addStatement("val docId = $idResolve") saveBuilder.addStatement( - "val upsertedDoc = %T.${upsertDocumentMethod(useSuspend)}(doc, docId, %S)", + "val upsertedDoc = %T.${upsertDocumentMethod(useSuspend)}(doc, docId, %S, %S)", PersistenceConfig::class, - holder.dbName + holder.dbName, + holder.collection ) saveBuilder.addStatement("rebind(upsertedDoc)") } @@ -310,10 +328,11 @@ class EntityGeneration { return listOf( FunSpec.builder("create").addModifiers(evaluateModifiers(useSuspend)) .addParameter("id", String::class).addAnnotation(JvmStatic::class).addStatement( - "return %N(%T.${getDocumentMethod(useSuspend)}(id, %S) ?: mutableMapOf(_ID to id))", + "return %N(%T.${getDocumentMethod(useSuspend)}(id, %S, %S) ?: mutableMapOf(_ID to id))", holder.entitySimpleName, PersistenceConfig::class, - holder.dbName + holder.dbName, + holder.collection ).returns(holder.entityTypeName).build(), FunSpec.builder("create").addModifiers(KModifier.PUBLIC, KModifier.OVERRIDE) .addAnnotation(JvmStatic::class).addStatement( diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt index 07a05274..be262bcb 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/generation/model/WrapperGeneration.kt @@ -51,8 +51,24 @@ class WrapperGeneration { for (fieldHolder in holder.allFields) { companionSpec.addProperties(fieldHolder.createFieldConstant()) - typeBuilder.addProperty(fieldHolder.property(null, holder.abstractParts, false, holder.deprecated, typeConvertersByConvertedClass)) - fieldHolder.builderSetter(null, holder.sourcePackage, holder.entitySimpleName, false, holder.deprecated)?.let { + typeBuilder.addProperty( + fieldHolder.property( + dbName = null, + collection = null, + holder.abstractParts, + useMDocChanges = false, + holder.deprecated, + typeConvertersByConvertedClass + ) + ) + fieldHolder.builderSetter( + dbName = null, + collection = null, + holder.sourcePackage, + holder.entitySimpleName, + useMDocChanges = false, + holder.deprecated + )?.let { builderBuilder.addFunction(it) } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt index adee8697..875b3b59 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/EntityFactory.kt @@ -30,6 +30,7 @@ object EntityFactory { sourceModel, EntityHolder( annotation.database, + annotation.collection, annotation.modifierOpen, annotation.type, sourceModel diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/EntityHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/EntityHolder.kt index b6575f8d..dc42ba09 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/EntityHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/EntityHolder.kt @@ -7,7 +7,13 @@ import com.squareup.kotlinpoet.KModifier import com.squareup.kotlinpoet.PropertySpec import com.schwarz.crystalapi.Entity -class EntityHolder(val dbName: String, val modifierOpen: Boolean, val entityType: Entity.Type, sourceModel: ISourceModel) : +class EntityHolder( + val dbName: String, + val collection: String, + val modifierOpen: Boolean, + val entityType: Entity.Type, + sourceModel: ISourceModel +) : BaseEntityHolder(sourceModel) { fun dbNameProperty(): PropertySpec { @@ -16,4 +22,11 @@ class EntityHolder(val dbName: String, val modifierOpen: Boolean, val entityType return builder.build() } + + fun collectionProperty(): PropertySpec { + val builder = PropertySpec.builder("_collection", TypeUtil.string(), KModifier.PUBLIC) + .getter(FunSpec.getterBuilder().addStatement("return %S", collection).build()) + + return builder.build() + } } diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblBaseFieldHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblBaseFieldHolder.kt index 9419b938..60246e1c 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblBaseFieldHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblBaseFieldHolder.kt @@ -60,6 +60,7 @@ abstract class CblBaseFieldHolder(val dbField: String, private val mField: Field abstract fun property( dbName: String?, + collection: String?, possibleOverrides: Set, useMDocChanges: Boolean, deprecated: DeprecatedModel?, @@ -68,6 +69,7 @@ abstract class CblBaseFieldHolder(val dbField: String, private val mField: Field abstract fun builderSetter( dbName: String?, + collection: String?, packageName: String, entitySimpleName: String, useMDocChanges: Boolean, diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt index 65e44f18..951b1d78 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblConstantHolder.kt @@ -38,6 +38,7 @@ class CblConstantHolder(field: Field) : CblBaseFieldHolder(field.name, field) { override fun property( dbName: String?, + collection: String?, possibleOverrides: Set, useMDocChanges: Boolean, deprecated: DeprecatedModel?, @@ -98,6 +99,7 @@ class CblConstantHolder(field: Field) : CblBaseFieldHolder(field.name, field) { override fun builderSetter( dbName: String?, + collection: String?, packageName: String, entitySimpleName: String, useMDocChanges: Boolean, diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt index f569a280..dae511eb 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/field/CblFieldHolder.kt @@ -67,6 +67,7 @@ class CblFieldHolder(field: Field, classPaths: List, subEntityNameSuffix override fun property( dbName: String?, + collection: String?, possibleOverrides: Set, useMDocChanges: Boolean, deprecated: DeprecatedModel?, @@ -208,6 +209,7 @@ class CblFieldHolder(field: Field, classPaths: List, subEntityNameSuffix override fun builderSetter( dbName: String?, + collection: String?, packageName: String, entitySimpleName: String, useMDocChanges: Boolean, diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt index c1a02a1c..472f8b65 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/query/CblQueryHolder.kt @@ -25,6 +25,7 @@ class CblQueryHolder(private val mQuery: Query) { fun queryFun( dbName: String, + collection: String, entityHolder: BaseEntityHolder, useSuspend: Boolean, typeConvertersByConvertedClass: Map @@ -64,9 +65,10 @@ class CblQueryHolder(private val mQuery: Query) { } builder.beginControlFlow( - "return %T.${queryDocumentMethod(useSuspend)}(%S, queryParams, null, %N).map", + "return %T.${queryDocumentMethod(useSuspend)}(%S, %S, queryParams, null, %N).map", PersistenceConfig::class, dbName, + if (collection.isEmpty()) "null" else collection, CblReduceGeneration.PROPERTY_ONLY_INCLUDES ) builder.addStatement("%T(it)", entityHolder.entityTypeName) diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/JavaAnnotationUtil.java b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/JavaAnnotationUtil.java index 385eaf07..e94320c9 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/JavaAnnotationUtil.java +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/util/JavaAnnotationUtil.java @@ -35,6 +35,9 @@ public Type type() { public String database() { return source.database(); } + + @Override + public String collection() { return source.collection(); } }; return annotation; diff --git a/demo/src/test/java/kaufland/com/demo/UnitTestConnector.kt b/demo/src/test/java/kaufland/com/demo/UnitTestConnector.kt index 2dad7cce..e218962e 100644 --- a/demo/src/test/java/kaufland/com/demo/UnitTestConnector.kt +++ b/demo/src/test/java/kaufland/com/demo/UnitTestConnector.kt @@ -4,7 +4,7 @@ import com.schwarz.crystalapi.PersistenceConfig import com.schwarz.crystalapi.TypeConversionErrorWrapper open class UnitTestConnector() : PersistenceConfig.Connector { - override fun deleteDocument(id: String, dbName: String) { + override fun deleteDocument(id: String, dbName: String, collection: String) { // Do Nothing }