Skip to content

Commit

Permalink
✨ mica-activerecord 优化,只有在开启 自动表扫描 时校验 模型的包路径
Browse files Browse the repository at this point in the history
  • Loading branch information
li-xunhuan committed Nov 28, 2024
1 parent 3aa9dfa commit 5276368
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ public ActiveRecordPlugin activeRecordPlugin(IDataSourceProvider dataSourceProvi
ResourceLoader resourceLoader,
MicaActiveRecordProperties properties,
ObjectProvider<ActiveRecordPluginCustomizer> 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());
Expand All @@ -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
Expand Down

0 comments on commit 5276368

Please sign in to comment.