Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generic type is not support in entity? #851

Open
taosimple opened this issue Dec 27, 2024 · 0 comments
Open

Generic type is not support in entity? #851

taosimple opened this issue Dec 27, 2024 · 0 comments

Comments

@taosimple
Copy link

build Error:

[SEVERE] floor_generator on lib/db/db.dart:

Column type is not supported for T?.
package:easy_table/bean/chat_message.dart:21:6
   ╷
21 │   T? content;
   │      ^^^^^^^
   ╵

Code bean

abstract class Message<T> {
  int time;
  String? role;
  T? content;  
}

@JsonSerializable()
@Entity(
  tableName: TABLE_CHAT_MESSAGE,
  indices: [
    Index(value: ['pageUid'])
  ],
)
class TextMessage extends Message<String>{
  List<ToolCall>? tool_calls;
}

Code db

@Database(version: DB_VERSION, entities: [TextMessage])
@TypeConverters([])
abstract class DB extends FloorDatabase {
....
}
@taosimple taosimple changed the title Generic type is not support in class bean ? Generic type is not support in bean class? Dec 27, 2024
@taosimple taosimple changed the title Generic type is not support in bean class? Generic type is not support in entity? Dec 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant