Home > Back-end >  Consult about lombok. Data annotations of a problem
Consult about lombok. Data annotations of a problem

Time:02-04

The spring for the first time the boot program and found the following code is used lombok. Data annotation

But I really don't know whether this property deptIdList is how to deal with

 import lombok. Data; 

Import the Java. IO. Serializable.
import java.util.List;

@ Data
Public class UserDetail implements Serializable {
private static final long serialVersionUID=1L;

private Long id;
private String username;
Private String realName;
Private String headUrl;
Private Integer gender;
Private String email;
private String mobile;
Private Long deptId;
private String password;
private Integer status;
Private Integer superAdmin;
/* *
* department data access
*/
Private List DeptIdList;

}


In another place a call to the user. The getDeptIdList

Idea to check the way defined directly on the code above deptIdList attributes?

//department ID list 
List DeptIdList=user. GetDeptIdList ();


Want to go in my whole meng, debugging user. GetDeptIdList () method, and also can't get into,

Consult bosses this is what operation,,

I just want to know getDeptIdList () method is what is the content inside the


CodePudding user response:

Lombok is good at compile time give you compile the get method such as the set, you can see the class files generated, in some,

CodePudding user response:

Public List GetDeptIdList () {
Return deptIdList;
}

Is it, just like ordinary,

You go to have a look at the compiled target, the annotations can get directly at compile time, the set those methods are generated

CodePudding user response:

refer to the original poster Ma Laohu response:
for the first time the whole spring boot project, found the following code using the lombok. Data annotation

But I really don't know how the deptIdList this property of


Lombok. The Data is a convenient programming annotation framework, will help you automatically the entity class to add the get set package, you just write a class variable,
  • Related