Create a new POJO class
@Data public class UserInfo { private Long userId; private String userKey; }
Use the data annotation in lombook, but make an error when using it
UserInfo()’ in ‘com.example.gmall.cart.pojo.UserInfo’ cannot be applied to ‘(long, java.lang.String)’
Reason: POJO class only uses Data annotation and lacks construction method,
Solution: use annotation @AllArgsConstructor @NoArgsConstructor or construct directly
@Data @AllArgsConstructor @NoArgsConstructor public class UserInfo { private Long userId; private String userKey; }
Similar Posts:
- Error attempting to get column ‘xxx’ from result set. Cause: java.sql.sqlexception: unable to convert to internal representation. Error resolution during Oracle database query
- [Solved] C# The type or namespace name ‘DllImport’ could not be found
- Android Exception: UncaughtException detected: java.lang.RuntimeException: Parcelable encountered IOExcepti
- Springmvc Error: HTTP Status 500 – Could not write content: No serializer
- Quartz: add transaction rollback error [How to Solve]
- JAVA Error: Failed to convert property value of type ‘java.lang.String‘ to required type ‘java.util.Date
- Two ways to implement Spring Boot’s scanmapper interface class
- Request failed with status code 500 & Self referencing loop detected for property ‘xx‘ with type
- [Solved] Using Jackson string to convert entity to report error: mismatchedinput exception: cannot construct instance of
- [Solved] SpringBoot Startup Error: is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)