kandraKodein

fun Application.kandraKodein()

Extends the application's Kodein DI container with a KandraRepository and KandraSuspendRepository binding for every entity registered in SchemaRegistry.

Must be called after install(Kandra). All repos share the plugin's BatchEngine, so shutdown protection and in-flight tracking apply to DI-managed repos too.

Repositories are bound by tag:

  • KandraRepository<*> tagged with "${EntityName}"

  • KandraSuspendRepository<*> tagged with "${EntityName}Suspend"

Tags are derived purely from Class.getSimpleName, so two @ScyllaTable entities that share a simple name (e.g. billing.User and admin.User) would otherwise collide and cause a confusing generic binding-override error from Kodein itself. To surface a clear cause instead, this checks for simple-name collisions across every registered entity before building any bindings and throws KandraSchemaException naming the colliding classes. See GH-35.