无法生成小写的 greenDao 实体

Can not generate greenDao Entity with lowercase

我在我的项目中使用 GreenDao 库,当我想从数据库读取时遇到问题,它给了我 android.database.sqlite.SQLiteException: no such table

我知道发生这种情况的原因。这是因为当我生成方案并像这样添加实体时:addEntity("userX") 生成的 table 是 USER_X

问题是我已经从 assets 加载了数据库,table 名称是 userX,而不是 USER_X。我在 greendao doc 中读到:For example, a property called “creationDate” will become a database column “CREATION_DATE”.

我的问题是如何更改这些默认值? 我在文档中搜索了解决方案,但没有找到任何解决方案。我的问题有解决方案吗?

谢谢

我从来没有用过它,但是看着 this documentation and this source code,似乎可以对实体使用这种方法

Entity e = addEntity("userX");
e.setTableName("userX");

这是属性

e.addDateProperty("creationDate").columnName("creationDate");