jerryshao commented on code in PR #7530:
URL: https://github.com/apache/gravitino/pull/7530#discussion_r2177092842


##########
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:
   Like classloader related exception, I would suggest catching, loging and 
converting to `RuntimeException`, what do you think? I don't have a strong 
opinon on this, just my feelings.



-- 
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]

Reply via email to