alaahong commented on issue #366:
URL: https://github.com/apache/fesod/issues/366#issuecomment-3352748573
Seems this is caused by no support for Proxy Object by BeanMap.
The temporary solution is manually cast to new DTO
```
List<LogExportDto> dtoList = projections.stream()
.map(p -> new LogExportDto(
p.getOperator(),
p.getOperatorTime(),
p.getDataType(),
p.getEvent(),
p.getEventDescription()
)).toList();
```
or process with interim Map.
```
Specification<LogEntity> spec = (root, query, cb) ->
cb.conjunction();
List<LogExport> all = repository.findBy(spec, q ->
q.as(LogExport.class).all());
List<Map<String, Object>> rows = all.stream()
.map(p -> {
Map<String, Object> m = new LinkedHashMap<>();
m.put("operator", p.getOperator());
m.put("operatorTime", p.getOperatorTime());
m.put("dataType", p.getDataType());
m.put("event", p.getEvent());
m.put("eventDescription", p.getEventDescription());
return m;
})
.toList();
try (ExcelWriter writer =
FastExcel.write(output).withTemplate(template).build()) {
WriteSheet writeSheet = FastExcel.writerSheet(0).build();
FillConfig userFillConfig =
FillConfig.builder().forceNewRow(true).build();
writer.fill(rows, userFillConfig, writeSheet);
}
```
And meanwhile, it's also welcome @en-o or else to contribute the compatible
solution inside Fesod level.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]