Search code examples
spring-bootjooq

why the org.jooq.field or SelectField cannot return From SpringBoot.RestController?



    @PostMapping("/field")
    @ApiOperation(value = "合并Field")
    public Result<List<Field<String>>> mergeField(
            @ApiParam(value = "expressionMergeDTO") @RequestBody ExpressionMergeDTO expressionMergeDTO) {
        List<Field<String>> fields = expressionMergeService.mergeField(expressionMergeDTO);
        return Result.ok(fields);
    }

I write a controller method to RestController on SpringBoot, Tomcat containner, using Http protocal,but when i run/debug this application, i cannot get it up, service just like blocked I am sure problem occured because of this method, and I have tried some other class , SelectField and Field have same problems, but OrderField run normally, so why?

some pics are showing below:

enter image description here

enter image description here

enter image description here

i want to know why this happen?


Solution

  • I'm not sure what the requirements are for Spring to be able to serialise objects as REST API results, but you're probably better off serialising the Field's name rather than the field instance itself, e.g. call Field.getName() and serialise that:

    return Result.ok(fields.stream().map(Field::getName).toList());