Tencent / wcdb

WCDB is a cross-platform database framework developed by WeChat.
Other
10.61k stars 1.39k forks source link

Can't find column "xxx" in class orm config. #1111

Closed philipdroid closed 3 weeks ago

philipdroid commented 1 month ago

The language of WCDB

Kotlin, ksp

The version of WCDB

2.1.4

The platform of WCDB

Android

The installation of WCDB

Maven

What's the issue?

Hi, i have a SDK project using RoomX. Resently i'm trying to switch to WCDB, but there's a problem confusing me. There's an entity class named GroupMember, groupID and userID are two important attributes, and they will be treated as MultiPrimary columns. For history reason, groupID and userID are attribute names of GroupMember entity, but the corresponding field name in the database table are group_id and user_id. I have followed the wiki guide to config the build.gradle correctly, and some of DBxxx file are generated successfully. BTW, i'm using ksp. But DBGroupMember is not generated. This is screenshots for errors:

1718261857999

After checking wiki guides, i found this:

1718264202008

So i changed the MultiPrimary columns name to database table field name, like this:

1718264792111

After rebuild, new error occurs:

1718264707209

If i rename GroupMember attribute names groupID and userID to group_id and user_id directly, it works, but i think it's unacceptable, because theSDK has been accessed by the customer and is running online, This change will result in changes to the access party's business code.

This is a perplexing question for me, any help is welcome.

Qiuwen-chen commented 1 month ago

Got it, I will fix it soon, please wait.

Qiuwen-chen commented 3 weeks ago

Fixed in 2.1.6