Lombok @data and @builder are used together
Lombok often uses annotations
error
Sometimes @Builder annotation is added to PO class in order to make the code more elegant when constructing PO class. However, because @Builder and @Data will be used together, the class’s no-argument constructor will be overwritten. As a result, some framework can not successfully assign Data to PO class when operating the database, such as MyBatis.
The solution
Override the no-argument constructor in the class to prevent conflict with Lombok’s annotation, and add the @tolerate annotation on the no-argument constructor
Such as:
@Data
@Builder
public class DataBuilder implements Serializable {
@Tolerate
public DataBuilder (){}
}
Lombok uses annotations
A lot of online lecture Here I think a good link
https://www.cnblogs.com/heyonggang/p/8638374.html
Read More:
- Error attempting to get column ‘xxxxx’ from result set — after Lombok is annotated with builder, mybatis cannot recognize the correct type of field
- Brief introduction of idea Lombok and solutions for reporting red and wrong
- This (code, message, data: null) still exists after importing spring cloud project into Lombok; the data in the project is unrecognized
- [idea] error occurred when using @ data annotation in Lombok: no related get / set method was found
- Data analysis to obtain Yahoo stock data: some problems are encountered when using panda datareader (cannot import name ‘is_ list_ Like ‘problem)
- Using Lombok to compile and report errors
- Error reporting: attributeerror: module ‘******* has no attribute’ ******* and other problems are solved
- Idea startup project Lombok error, no symbol found
- Inconsistency between adapter data and UI data after dragging recyclerview (data disorder)
- What are the web front end technologies? What are the differences between cookie and session
- Error reporting – the project directly introduces the error reporting and solution of. SCSS file
- As Error:Could not determine the class-path for interface com.android.builder.model.AndroidProject.
- Caused by: org.apache.ibatis.builder.BuilderException: Error resolving class. Cause: org.apache.ibat
- A solution to the error of asynchronous socket error 10053 in C + + Builder
- No data: data: get host by name failed in TCP_ Connect() error resolution
- circuit_breaking_exception,“reason“:“[parent] Data too large, data for [<http_request>]
- Error building SqlSession. ### Cause: org.apache.ibatis.builder.BuilderException: Error creating d
- How to Fix Sklearn ValueError: This solver needs samples of at least 2 classes in the data, but the data
- Django + jQuery get data in the form + Ajax send data
- Failed to load response data:No data found for resource with given identifie