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 12636ae9..4aa7636c 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 @@ -59,6 +59,7 @@ class EntityGeneration { .addModifiers(KModifier.PUBLIC) .addSuperinterface(TypeUtil.iEntity()) .addSuperinterface(holder.interfaceTypeName) + .addSuperinterfaces(holder.collectAllChildInterfaces()) .addProperty(holder.dbNameProperty()) .addFunction(EnsureTypesGeneration.ensureTypes(holder, false)) .addFunction(CblDefaultGeneration.addDefaults(holder, false)) 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 291a2f61..a8ea0827 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 @@ -19,6 +19,7 @@ class WrapperGeneration { .addSuperinterface(TypeUtil.mapSupport()) .addModifiers(KModifier.PUBLIC) .addSuperinterface(holder.interfaceTypeName) + .addSuperinterfaces(holder.collectAllChildInterfaces()) .addFunction(EnsureTypesGeneration.ensureTypes(holder, true)) .addFunction(CblDefaultGeneration.addDefaults(holder, true)) .addFunction(CblConstantGeneration.addConstants(holder, true)) diff --git a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/BaseEntityHolder.kt b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/BaseEntityHolder.kt index 7d37f28b..9164783d 100644 --- a/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/BaseEntityHolder.kt +++ b/crystal-map-processor/src/main/java/com/schwarz/crystalprocessor/model/entity/BaseEntityHolder.kt @@ -55,4 +55,10 @@ abstract class BaseEntityHolder(val sourceElement: ISourceModel) : IClassModel b val interfaceTypeName: TypeName get() = ClassName(sourcePackage, interfaceSimpleName) + + fun collectAllChildInterfaces(): List { + val basedOnInterfaceTypeNames = basedOn.map { it.interfaceTypeName } + val reducesModelsInterfaceTypeNames = reducesModels.map { ClassName(sourcePackage, "I${it.namePrefix}$sourceClazzSimpleName") } + return listOf(*basedOnInterfaceTypeNames.toTypedArray(), *reducesModelsInterfaceTypeNames.toTypedArray()) + } }