litesuits / android-lite-orm

LiteOrm is a fast, small, powerful ORM framework for Android. LiteOrm makes you do CRUD operarions on SQLite database with a sigle line of code efficiently.
http://litesuits.com?form=gorm
Apache License 2.0
1.49k stars 362 forks source link

实体类中有集合,存不进去 #46

Open lxc7923 opened 7 years ago

lxc7923 commented 7 years ago

代码如下,我发现集合类型的字段存不进去,这块应该怎么处理呢? `@Table("OutlineTreeTest2") public class OutlineTreeVo implements Serializable {

@PrimaryKey(AssignType.BY_MYSELF)
private int outlineId;

private String outlineName;
private int sequence;
private int hierarchyId;
private int parentId;
private int initialId;//大纲初始ID
private String status;
private int examCount;
@Mapping(Relation.OneToMany)
private List<Long> examIds;
private int examFilterCount;
@Ignore
private List<Long> examFilterIds;
private int doneExamCount;
@Ignore
private List<Long> doneExamIds;
private int correctExamCount;
@Ignore
private List<Long> correctExamIds;
private String rightRate;
//统计信息
@Mapping(Relation.OneToOne)
private OutlineStatisticVo outlineStatisticVo;
@Mapping(Relation.OneToMany)
private List<OutlineTreeVo> children;`
litesuits commented 7 years ago

你的集合是抽象类,不可以被具象化和实例化。数据存储对象需要使用具体容积ArrayList等。

ObliverSen commented 6 years ago

你的集合是抽象类,不可以被具象化和实例化。数据存储对象需要使用具体容积ArrayList等。

不需要啊。我的就没有使用具体的arrayList。这个是 不同版本的原因嘛?? 我的是Parcelable 序列化之后,就不能存数据了。。