greendao @keep 和 Generated

前言:使用greendao是我从这个项目开始的,刚开始使用也是挺顺手,接入很方便,但是在使用过程中,突然发现有好多坑;现在整理一下,希望能帮到别人;
1.使用greendao更新数据数据之后,再次查询后居然不是更新过的数据,查询语句和查询逻辑过了一遍,没有任何问题,最后我在实体类中发现了问题:

@Generated(hash = 96597824)
public WorkTicketSecurityBean(Long id, int srSourceId, int srId, int srNumber,
        String srTypeCode, String srTypeDesc, String sepObjectId, String description,
        String attribute1, String srStatus, String overhaulSelf, String srContent,
        int connenctNumber, int flag) {
    this.id = id;
    this.srSourceId = srSourceId;
    this.srId = srId;
    this.srNumber = srNumber;
    this.srTypeCode = srTypeCode;
    this.srTypeDesc = srTypeDesc;
    this.sepObjectId = sepObjectId;
    this.description = description;
    this.attribute1 = attribute1;
    this.srStatus = srStatus;
    this.overhaulSelf = overhaulSelf;
    this.srContent = srContent;
    this.connenctNumber = connenctNumber;
    this.flag = flag;
}

@Generated(hash = 1155046177)
public WorkTicketSecurityBean() {
}

这个是修改之后的代码,主要问题就是注解 @Generated ,这个注解的意思是:
GreenDao运行所产生的构造函数或者方法,被此标注的代码可以变更或者下次运行时清除

@Keep
注解的代码段在GreenDao下次运行时保持不变
1.注解实体类:默认禁止修改此类
2.注解其他代码段,默认禁止修改注解的代码段

这个会不会导致查询之后的无法修改这个实体类,还未验证,做此记录!

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值