GreenDao 的问题
报错:
Error:Execution failed for task ':app:greendao'.
> Can't replace method in G:\workspase\ZZXia\app\src\main\java\com\cxb\zzxia\mvp\model\ThirdCarBrandModel.java:120 with generated version.
If you would like to keep it, it should be explicitly marked with @Keep annotation.
Otherwise please mark it with @Generated annotation
实体:
/**
* @author Created by zhumj
* @function 汽车次级品牌模型
*/
@Entity
public class SecondCarBrandModel implements Serializable {
/**
* id : 219
* name : 一汽-大众奥迪
* fullname :
* initial : A
* price :
* parentid : 1
* depth : 2
* carlist : [{"id":"220","name":"A3","fullname":"奥迪A3","initial":"A","parentid":"219","logo":"http://pic1.jisuapi.cn/car/static/images/logo/300/220.jpg","price":"","salestate":"在销","depth":"3","list":[{"id":"41375","name":"2018款 30周年纪念版 Sportback 35TFSI 进取版","initial":"A","parentid":"220","logo":"41375.jpg","price":"19.23万","yeartype":"2018","productionstate":"在产","salestate":"在销","sizetype":"紧凑型车","depth":"4"}]}]
*/
@Transient
static final long serialVersionUID = 41L;
@Id
private long id;
private String name;
private String fullname;
private String initial;
private String price;
private int parentid;
private int depth;
@ToMany(referencedJoinProperty = "parentid")
private List<ThirdCarBrandModel> carlist;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getInitial() {
return initial;
}
public void setInitial(String initial) {
this.initial = initial;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public int getParentid() {
return parentid;
}
public void setParentid(int parentid) {
this.parentid = parentid;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
@Generated
public List<ThirdCarBrandModel> getCarlist() {
return carlist;
}
public void setCarlist(List<ThirdCarBrandModel> carlist) {
this.carlist = carlist;
}
}
/**
* @author Created by zhumj
* 汽车三级品牌模型
*/
@Entity
public class ThirdCarBrandModel implements Serializable {
/**
* id : 220
* name : A3
* fullname : 奥迪A3
* initial : A
* parentid : 219
* logo : http://pic1.jisuapi.cn/car/static/images/logo/300/220.jpg
* price :
* salestate : 在销
* depth : 3
* list : [{"id":"41375","name":"2018款 30周年纪念版 Sportback 35TFSI 进取版","initial":"A","parentid":"220","logo":"41375.jpg","price":"19.23万","yeartype":"2018","productionstate":"在产","salestate":"在销","sizetype":"紧凑型车","depth":"4"}]
*/
@Transient
static final long serialVersionUID = 42L;
@Id
private long id;
private String name;
private String fullname;
private String initial;
private int parentid;
private String logo;
private String price;
private String salestate;
private int depth;
@ToMany(referencedJoinProperty = "parentid")
@Generated
private List<FourthCarBrandModel> list;
public long getId() {
return id;
}
public void setId(long id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getFullname() {
return fullname;
}
public void setFullname(String fullname) {
this.fullname = fullname;
}
public String getInitial() {
return initial;
}
public void setInitial(String initial) {
this.initial = initial;
}
public int getParentid() {
return parentid;
}
public void setParentid(int parentid) {
this.parentid = parentid;
}
public String getLogo() {
return logo;
}
public void setLogo(String logo) {
this.logo = logo;
}
public String getPrice() {
return price;
}
public void setPrice(String price) {
this.price = price;
}
public String getSalestate() {
return salestate;
}
public void setSalestate(String salestate) {
this.salestate = salestate;
}
public int getDepth() {
return depth;
}
public void setDepth(int depth) {
this.depth = depth;
}
public List<FourthCarBrandModel> getList() {
return list;
}
public void setList(List<FourthCarBrandModel> list) {
this.list = list;
}
}
报错英文我都能看懂,然并卵,请教大神们解决方法
相关推荐
Greendao3GradlePlugin:Deprecate!该项目不再维护!greendao 3.3.0已修复该问题!-----------------基于greendao-gradle-plugin开发的代码生成插件,用于解决greendao插件在windows、macOS上生成代码不一致以及增量编译代码排序问题。使用时请替换掉原greendao插件
Greendao3GradlePlugin Greendao 3生成代码插件,非增量编译模式下,在macOS上运行,由于文件系统的差异,可能出现 生成的DaoSession和DaoMaster内容乱序,但是在Windows系统上运行,内容是按字母排序。同 时,greendao生成plugin支持增量编译,但是该特性生成的代码也会与全量生成的代码不一致。所 以为了解决双平台生成代码不一致,git不便管理的问题,为此基于greendao的plugin,创建了本 plugin。 该插件基于greendao gradle插件3.2.2版本(org.greenrobot:greendao-gradle-plugin:3.2.2)进行开发。 Add plugin to your project 插件已上传到jcenter。 // In your root build.gradle file: buil
Greendao数据库升级添加String类型,
有关数据库更新,添加String类型同步更新没问题,greendao有个bug,就是添加别的类型都会报错
融云使用greenDao文件
融云内置greenDao数据库,但使用greendao-generator自动生成的代码直接复制到项目中,会报错,少个参数:tableName,此java 项目就是为生成融云兼容的数据库文件
greenDao测试所用android项目
在学习使用greenDao第三方数据库的时候,所用的android项目
sqlite框架GreenDao
Greendao是一款用于数据库创建与管理的框架,摆脱传统的复杂的sqlite,使用更加的方便快捷


