我尝试使用 Parceler 使用 ORMLite,但 Parceler 发现错误:
Error:(44, 36) error: Parceler: Unable to find read/write generator for type com.j256.ormlite.dao.ForeignCollection<PassKeyItem> for CategoryItem.passKeyItems
这是我的对象:
CategoryItem.class
@Parcel
@DatabaseTable(tableName = "categories")
public class CategoryItem {
...
@ForeignCollectionField(columnName = FIELD_PASS_KEY_ITEMS)
ForeignCollection<PassKeyItem> passKeyItems;
}
PassKeyItem.class
@Parcel
@DatabaseTable(tableName = "passkey")
public class PassKeyItem {
...
@DatabaseField(foreign = true, foreignAutoRefresh = true, columnName = FIELD_CATEGORY_ITEM_ID)
private CategoryItem categoryItem;
}