-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed as not planned
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid
Description
Hi
I used record classes on Controller
and Service
to simplify the loading of Bean, but it doesn't seem to work, suggesting that CGLIB subclasses cannot be generated.
Controller: I can understand that, after all, it doesn't implement any interface, but Service has implemented the interface, and it still can't be enhanced by JDK Proxy.
The following is the pseudo code I used.
@Validated
@RestController
@RequestMapping("/users")
public record UserController(IUserService userService) {
// some biz code...
}
@Service
public record UserServiceImpl(UserMapper userMapper) implements IUserService {
// some biz code...
}
Interestingly, this code did not report errors at compile time, and IDEA can also identify their dependencies normally.
It would be great if the record class could be used on stateless bean, although Java is not Kotlin.
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)status: invalidAn issue that we don't feel is validAn issue that we don't feel is valid