【发布时间】:2018-07-05 10:19:38
【问题描述】:
我正在使用 lombok 为我的模型生成构造函数、getter 和 setter。当我尝试使用 lombok 为我的实体类生成构造函数时,出现此错误
Error:(14, 8) error: Entities and Pojos must have a usable public
constructor. You can have an empty constructor or a constructor whose
parameters match the fields (by name and type).
Tried the following constructors but they failed to match:
Region(int,java.lang.String,java.lang.String) -> [param:arg0 -> matched
field:unmatched, param:arg1 -> matched field:unmatched, param:arg2 ->
matched field:unmatched]
但是手动编写构造函数是可行的。谁能帮我找出问题所在?
我的实体类如下所示
@Value
@Entity
public class Region {
@PrimaryKey
private int regionId;
private String name;
private String code;
}
房间版本:1.1.0 龙目岛版本:1.16.20
【问题讨论】:
标签: android android-room lombok