GreenDao 的问题

头发还没秃a 2017-12-11 06:39:43
本来一直使用着OrmLite的,今天突然想在新项目换个框架,然后.......尼玛的被卡的快要哭了。。。。
报错:

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;
}
}


报错英文我都能看懂,然并卵,请教大神们解决方法
...全文
527 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
头发还没秃a 2018-02-06
  • 打赏
  • 举报
回复
送分了送分了,第一个进来的有分哟
jklwan 2018-02-06
  • 打赏
  • 举报
回复
好像greenDao会自动生成get/set方法,删掉就行了

80,337

社区成员

发帖
与我相关
我的任务
社区描述
移动平台 Android
androidandroid-studioandroidx 技术论坛(原bbs)
社区管理员
  • Android
  • yechaoa
  • 失落夏天
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧