diff --git a/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/parser/MetadataParser.kt b/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/parser/MetadataParser.kt index 09f9f434..55b94489 100644 --- a/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/parser/MetadataParser.kt +++ b/ktorm-ksp-compiler/src/main/kotlin/org/ktorm/ksp/compiler/parser/MetadataParser.kt @@ -134,6 +134,7 @@ internal class MetadataParser(resolver: Resolver, environment: SymbolProcessorEn } private fun parseColumnMetadata(property: KSPropertyDeclaration, table: TableMetadata): ColumnMetadata { + // @Column annotation is optional. val column = property.getAnnotationsByType(Column::class).firstOrNull() var name = column?.name @@ -195,7 +196,7 @@ internal class MetadataParser(resolver: Resolver, environment: SymbolProcessorEn if (!hasConstructor) { val msg = "" + - "Parse sqlType error for property $propName: the sqlType must be a Kotlin singleton object or " + + "Parse sqlType error for property $propName: the sqlType should be a Kotlin singleton object or " + "a normal class with a constructor that accepts a single org.ktorm.schema.TypeReference argument." throw IllegalArgumentException(msg) } diff --git a/ktorm-ksp-compiler/src/test/kotlin/org/ktorm/ksp/compiler/parser/MetadataParserTest.kt b/ktorm-ksp-compiler/src/test/kotlin/org/ktorm/ksp/compiler/parser/MetadataParserTest.kt index 9834afff..38b9f7db 100644 --- a/ktorm-ksp-compiler/src/test/kotlin/org/ktorm/ksp/compiler/parser/MetadataParserTest.kt +++ b/ktorm-ksp-compiler/src/test/kotlin/org/ktorm/ksp/compiler/parser/MetadataParserTest.kt @@ -147,7 +147,7 @@ class MetadataParserTest : BaseKspTest() { """.trimIndent()) @Test - fun testSqlTypeWithoutConstructor() = kspFailing("Parse sqlType error for property User.ex: the sqlType must be a Kotlin singleton object or a normal class with a constructor that accepts a single org.ktorm.schema.TypeReference argument.", """ + fun testSqlTypeWithoutConstructor() = kspFailing("Parse sqlType error for property User.ex: the sqlType should be a Kotlin singleton object or a normal class with a constructor that accepts a single org.ktorm.schema.TypeReference argument.", """ @Table interface User : Entity { @PrimaryKey