Minor fixes

This commit is contained in:
Andrew Golovashevich 2025-05-21 00:29:27 +03:00
parent ae92d1a407
commit 5197be80f0
5 changed files with 60 additions and 30 deletions

View File

@ -14,7 +14,7 @@ public class AccessWhileInitializationException : IllegalStateException, Copyabl
public val `object`: Any
public val member: Any
public constructor(scope: Any, `object`: Any, member: Any) : super() {
public constructor(scope: Any, `object`: Any, member: Any) : super(formatMessage(scope, `object`, member)) {
this.scope = scope
this.`object` = `object`
this.member = member
@ -32,7 +32,7 @@ public class AccessWhileInitializationException : IllegalStateException, Copyabl
this.member = member
}
public constructor(scope: Any, `object`: Any, member: Any, cause: Throwable) : super(cause) {
public constructor(scope: Any, `object`: Any, member: Any, cause: Throwable) : super(formatMessage(scope, `object`, member), cause) {
this.scope = scope
this.`object` = `object`
this.member = member

View File

@ -0,0 +1,55 @@
package ru.landgrafhomyak.db.skeleton1.api.errors
import kotlin.jvm.JvmStatic
import kotlinx.coroutines.CopyableThrowable
import kotlinx.coroutines.ExperimentalCoroutinesApi
import ru.landgrafhomyak.db.skeleton1.api.ReflectionApi
import ru.landgrafhomyak.db.skeleton1.api.statement.InputParam
import ru.landgrafhomyak.db.skeleton1.api.statement._Statement
@ReflectionApi
@OptIn(ExperimentalCoroutinesApi::class)
public class EntityDeletedException : IllegalStateException, CopyableThrowable<EntityDeletedException> {
public val entity: Any
public constructor(entity: Any) : super(formatMessage(entity)) {
this.entity = entity
}
public constructor(entity: Any, customMessage: String) : super(customMessage) {
this.entity = entity
}
public constructor(entity: Any, customMessage: String, cause: Throwable) : super(customMessage, cause) {
this.entity = entity
}
public constructor(entity: Any, cause: Throwable) : super(formatMessage(entity), cause) {
this.entity = entity
}
public constructor(
entity: Any,
message: String?,
cause: Throwable?,
@Suppress("unused", "LocalVariableName") _marker: Unit
) : super(message, cause) {
this.entity = entity
}
override fun createCopy(): EntityDeletedException? {
return EntityDeletedException(
entity = this.entity,
message = this.message,
cause = this.cause,
_marker = Unit
)
}
public companion object {
@JvmStatic
public fun formatMessage(entity: Any): String =
"Attempt to access deleted $entity"
}
}

View File

@ -43,26 +43,6 @@ public interface Module<mUE : Any> {
@get:JvmName("getMemberSubmodules")
public val memberSubmodules: Collection<Module<*>>
@ReflectionApi
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("getMemberTablesWhileUpgrade")
public val memberTablesWhileUpgrade: Collection<Table<*, mUE>>
@ReflectionApi
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("getMemberObjectsWhileUpgrade")
public val memberObjectsWhileUpgrade: Collection<ModuleScopedObject<*, mUE>>
@ReflectionApi
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("getMemberSubmodulesWhileUpgrade")
public val memberSubmodulesWhileUpgrade: Collection<Module<*>>
@ReflectionApi
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("willBeDeletedAfterUpgrade")
public val willBeDeletedAfterUpgrade: Boolean
public interface Constructor<mUE : Any> {
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("versionKey")
@ -85,9 +65,9 @@ public interface Module<mUE : Any> {
public interface Template<@Suppress("unused") mUE : Any> {
@LowLevelApi
public fun getConstructor(): Constructor<*>
public fun getConstructor(): Constructor<Any>
@LowLevelApi
public fun getUpgrade(version: String): Upgrade<*, *>?
public fun getUpgrade(version: String): Upgrade<Any, Any>?
}
}

View File

@ -25,7 +25,7 @@ public interface ModuleConstructorScope<mUE : Any> {
name: String, metadata: ObjectOperations.ImplementationsProvider<oUE>
): ModuleScopedObject<oUE, mUE>
public fun <mUE : Any> substituteModule(rootNs: Namespace<mUE>, template: Module.Template<mUE>): Module<mUE>
public fun <smUE : Any> substituteModule(rootNs: Namespace<mUE>, template: Module.Template<smUE>): Module<smUE>
public fun namespace(parent: Namespace<mUE>, name: String): Namespace<mUE>

View File

@ -20,9 +20,4 @@ public interface ModuleScopedObject<oUE : Any?, mUE : Any> {
@ReflectionApi
public val meta: ObjectOperations.ImplementationsProvider<oUE>
@ReflectionApi
@Suppress("INAPPLICABLE_JVM_NAME")
@get:JvmName("willBeDeletedAfterUpgrade")
public val willBeDeletedAfterUpgrade: Boolean
}