问题描述
|ERROR |main |MapperFactoryBean.java:82 |org.mybatis.spring.mapper.MapperFactoryBean |Error while adding the mapper 'interface com.miao.service.mapper.AdminMapper' to configuration.
org.apache.ibatis.reflection.ReflectionException: Illegal overloaded getter method with ambiguous type for property enabled in class class com.miao.service.entity.Admin. This breaks the JavaBeans specification and can cause unpredictable results.
at org.apache.ibatis.reflection.Reflector.resolveGetterConflicts(Reflector.java:138)
at org.apache.ibatis.reflection.Reflector.addGetMethods(Reflector.java:108)
at org.apache.ibatis.reflection.Reflector.<init>(Reflector.java:63)
解决方案
enabled属性遗漏@Getter(AccessLevel.NONE),正确如下:
@Getter(AccessLevel.NONE)
private Boolean enabled;
经查阅可以使用特殊AccessLevel.NONE访问级别手动禁用任何字段的getter / setter生成。这使可以重写的行为@Getter,@Setter或@Data对类注解。
希望对你有所帮助!