Maven Jar lombok

Scroll Down

maven Jar

<dependency>
    <groupId>org.projectlombok</groupId>
    <artifactId>lombok</artifactId>
</dependency>

实体类可以这样写:

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.io.Serializable;

@AllArgsConstructor//全参构造
@NoArgsConstructor//无参构造
@Data//get set
@Accessors(chain = true)//支持链式写法 ->  Dept dept=new Dept(); dept.setDeptno(11L).setDname(“RB”).setDb_source(“DB1”);
public class Dept implements Serializable//orm mssql -> Dept (table) 类关系映射
{
    private Long deptno;//主键
    private String dname;//部门
    private String db_source;

    public Dept(String dname){
        super();
        this.dname=dname;
    }
    public static void main(){
        Dept dept=new Dept();
        dept.setDeptno(11L).setDname(“RB”).setDb_source(“DB1”);
    }
}