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 361 forks source link

无法插入级联数据 #44

Open 740638339 opened 7 years ago

740638339 commented 7 years ago

@Table("product") public class ProductMdl implements Serializable {

@Unique
@PrimaryKey(AssignType.AUTO_INCREMENT)
private int id;

@Column("proName")
private String proName;

@Column("proPrice")
private String proPrice;

@Column("proNum")
private String proNum;

@Column("proPhotoUrl")
private String proPhotoUrl;

}

@Table("tablePro") public class TableProMdl implements Serializable { /* */ @Unique @PrimaryKey(AssignType.AUTO_INCREMENT) private int id;

private static final long serialVersionUID = -5204190870608983058L;
@Column("tableTitle")
private String mTableTitle;

@Column("proTotal")
private String mProTotal;

@Mapping(Relation.OneToMany)
private List<ProductMdl> mProList;

}

tablePro这个表中 插入数据其他字段都可以插入,mProList 插入不了!

740638339 commented 7 years ago

使用的是lite-orm-1.9.2.jar

litesuits commented 7 years ago

你的List是抽象的,需要具象化。比如用ArrayList

Hn1993 commented 7 years ago

但是用1.8.1的版本就可以直接插入 我刚才也是遇到这个 问题 更换了一个jar版本之后就好了