diff --git a/mica-activerecord/src/main/java/net/dreamlu/mica/activerecord/config/ActiveRecordConfiguration.java b/mica-activerecord/src/main/java/net/dreamlu/mica/activerecord/config/ActiveRecordConfiguration.java index b5c81fe91..cf49b5d63 100644 --- a/mica-activerecord/src/main/java/net/dreamlu/mica/activerecord/config/ActiveRecordConfiguration.java +++ b/mica-activerecord/src/main/java/net/dreamlu/mica/activerecord/config/ActiveRecordConfiguration.java @@ -146,8 +146,6 @@ public ActiveRecordPlugin activeRecordPlugin(IDataSourceProvider dataSourceProvi ResourceLoader resourceLoader, MicaActiveRecordProperties properties, ObjectProvider customizerObjectProvider) { - String modelPackage = properties.getModelPackage(); - Assert.hasText(modelPackage, "mica.activerecord.model-package is blank."); ActiveRecordPlugin arp = new ActiveRecordPlugin(dataSourceProvider); arp.setDialect(properties.getDialect().getDialect()); arp.setTransactionLevel(properties.getTransactionLevel().getLevel()); @@ -162,6 +160,8 @@ public ActiveRecordPlugin activeRecordPlugin(IDataSourceProvider dataSourceProvi } // 扫描和添加表映射 if (properties.isAutoTableScan()) { + String modelPackage = properties.getModelPackage(); + Assert.hasText(modelPackage, "mica.activerecord.model-package is blank."); scanTable(arp, environment, resourceLoader, modelPackage); } // arp 自定义配置 bean