Android DBFlow保存jsonArray数据库而不是循环cluase

是什么简单的方法来保存jsonArray模型,而不是使用循环cluase? 例如,此示例代码与领域数据库解决方案一起使用:

 realm.createAllFromJson(Categories.class, result); 

我的代码:

 @Table(database = AppDatabase.class) public class Categories { @PrimaryKey private String categoryId; @Column private String categoryName; @Column private String categoryDescription; @Column private String categoryImageFileName; @Column private String fileServerUrl; @Column private String categoryCount; public Categories() { } public String getCategoryId() { return categoryId; } public void setCategoryId(String categoryId) { this.categoryId = categoryId; } public String getCategoryName() { return categoryName; } public void setCategoryName(String categoryName) { this.categoryName = categoryName; } public String getCategoryDescription() { return categoryDescription; } public void setCategoryDescription(String categoryDescription) { this.categoryDescription = categoryDescription; } public String getCategoryImageFileName() { return categoryImageFileName; } public void setCategoryImageFileName(String categoryImageFileName) { this.categoryImageFileName = categoryImageFileName; } public String getFileServerUrl() { return fileServerUrl; } public void setFileServerUrl(String fileServerUrl) { this.fileServerUrl = fileServerUrl; } public String getCategoryCount() { return categoryCount; } public void setCategoryCount(String categoryCount) { this.categoryCount = categoryCount; } } } 

这是保存到数据库:

 final JSONArray result = data.getJSONArray("channelsCategories"); JSONArrayModel<Categories> listArea = new JSONArrayModel<>(result, Categories.class); 

我得到这个错误:

 Error:*==========*class com.raizlabs.android.dbflow.processor.ColumnValidator (Kotlin reflection is not available) :Could not find setter for private element: "channelStateId" from table class: Channels. Consider adding a setter with name setChannelStateId or making it more accessible.*==========* 

我不使用Android上的Kotlin