Skip to content

Commit

Permalink
fix naming
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentlauvlwj committed May 5, 2024
1 parent 24f4324 commit 9f3efe6
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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<User> {
@PrimaryKey
Expand Down

0 comments on commit 9f3efe6

Please sign in to comment.