mchades commented on code in PR #7530:
URL: https://github.com/apache/gravitino/pull/7530#discussion_r2177082119
##########
core/src/main/java/org/apache/gravitino/storage/relational/session/SqlSessionFactoryHelper.java:
##########
@@ -119,26 +101,10 @@ public void init(Config config) {
// Initialize the configuration
Configuration configuration = new Configuration(environment);
configuration.setDatabaseId(jdbcType.name().toLowerCase());
- configuration.addMapper(MetalakeMetaMapper.class);
- configuration.addMapper(CatalogMetaMapper.class);
- configuration.addMapper(SchemaMetaMapper.class);
- configuration.addMapper(TableMetaMapper.class);
- configuration.addMapper(TableColumnMapper.class);
- configuration.addMapper(FilesetMetaMapper.class);
- configuration.addMapper(FilesetVersionMapper.class);
- configuration.addMapper(TopicMetaMapper.class);
- configuration.addMapper(UserMetaMapper.class);
- configuration.addMapper(RoleMetaMapper.class);
- configuration.addMapper(UserRoleRelMapper.class);
- configuration.addMapper(GroupMetaMapper.class);
- configuration.addMapper(GroupRoleRelMapper.class);
- configuration.addMapper(SecurableObjectMapper.class);
- configuration.addMapper(TagMetaMapper.class);
- configuration.addMapper(TagMetadataObjectRelMapper.class);
- configuration.addMapper(OwnerMetaMapper.class);
- configuration.addMapper(ModelMetaMapper.class);
- configuration.addMapper(ModelVersionMetaMapper.class);
- configuration.addMapper(ModelVersionAliasRelMapper.class);
+ ServiceLoader<MapperPackageProvider> loader =
ServiceLoader.load(MapperPackageProvider.class);
+ for (MapperPackageProvider provider : loader) {
+ configuration.addMappers(provider.getPackageName());
Review Comment:
What exception are you referring to?
I think it's not needed, because if there is an exception here, it shouldn't
be caught, but let it interrupt the startup process.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]