braisdom / ObjectiveSql

Writing SQL using Java syntax
Apache License 2.0
1.27k stars 159 forks source link

java: 已在类 com.github.braisdom.objsql.benchmark.User中定义了变量 id #71

Closed oliviaour closed 3 years ago

oliviaour commented 3 years ago

Java 代码:

@DomainModel
public class User {

    private int id;
    private String name;
    private int age;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}

Maven 编译时错误:

Error:(6,8) java: 已在类 com.github.braisdom.objsql.benchmark.User中定义了变量 id
catchex commented 3 years ago

是个Bug,动态生成代码时,并没有判断 主键是否存在。