spring-boot-starter icon indicating copy to clipboard operation
spring-boot-starter copied to clipboard

The MapperScannerConfigurer should support FactoryBeans

Open missfmaster opened this issue 1 year ago • 1 comments
trafficstars

in MapperScannerConfigurer.java:

private String getPropertyValue(String propertyName, PropertyValues values) {
    PropertyValue property = values.getPropertyValue(propertyName);

    if (property == null) {
      return null;
    }

    Object value = property.getValue();

    if (value == null) {
      return null;
    } else if (value instanceof String) {
      return value.toString();
    } else if (value instanceof TypedStringValue) {
      return ((TypedStringValue) value).getValue();
    } else {
      return null;
    }
  }

but my value is RuntimeBeanReference ( implements FactoryBean ), be set:

builder.addPropertyReference("basePackage", basePackageBeanName);

so, value is null and get java.lang.IllegalArgumentException: At least one base package must be specified.

missfmaster avatar Apr 22 '24 03:04 missfmaster

the version is mybatis-spring-3.0.3

missfmaster avatar Apr 22 '24 03:04 missfmaster