Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When Lombok is combined with easyexcel, reading Excel files and reflecting them into entities are all null #2527

Closed
wzlstudy opened this issue Jul 24, 2020 · 2 comments

Comments

@wzlstudy
Copy link

Describe the bug
When Lombok is combined with easyexcel, reading Excel files and reflecting them into entities are all null

To Reproduce
The entity class attributes I defined are named after humps. When I use easyexcel to implement the write operation, I find that all the data written are null values, but the get and set methods generated by me can be written to the file normally.
@Data public class DataDemo { @ExcelProperty("一级分类") private String oName; @ExcelProperty("二级分类") private String tName; }

Expected behavior
If I use Lombok's @ Data annotation, this is how it works
dataDemo.setOName("dd");
dataDemo.setTName("dd");
But if I use the generated set method, the use is like this
dataDemo.setoame("dd");
dataDemo.settame("dd");
I think it is caused by the difference between the set method generated by @ Data annotation and the method approved by easyexcel
Version info (please complete the following information):

  • 1.18.12
  • jdk8

Additional context
Add any other context about the problem here.

@Rawi01
Copy link
Collaborator

Rawi01 commented Jul 28, 2020

I think that the problem here is that there are competing "standards" on how to generate getter and setter names in this corner case. See #757 for more details. To solve this one you can either rename your fields or write the required getters by hand.

@rzwitserloot
Copy link
Collaborator

Duplicate of #2693

@rzwitserloot rzwitserloot marked this as a duplicate of #2693 Jan 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants