Can mybatis comment results comments at the top of the class instead of the method?

@ Select ("SELECT FROM users") @ Results ({@ Result (property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @ Result (property = "nickName", column = "nick_name")} List < UserEntity > getAll (); @ Select ("SELECT FROM users WHERE id =-sharp {id}")

@Results({ @Result(property = "userSex", column = "user_sex", javaType = UserSexEnum.class), @Result(property = "nickName", column = "nick_name") }) UserEntity getOne(Long id);

if I want to write multiple methods, do I have to have multiple identical Results (,? if I can use the same Results (, in the same class, then do I have to paste the same code in different classes?

so can you liberate the Results (note) at the top of the result class

Mar.28,2021

Hello, @ Results and @ Result correspond to ResultMap and result,. They are both method-level annotations and cannot be annotated at the top of the class. If there is a comment that can be done, our efficiency will be greatly improved. If you find this efficient way, please reply to me. I am also looking forward to the efficient form

.
Menu