zhfeng commented on a change in pull request #2525:
URL: https://github.com/apache/camel-quarkus/pull/2525#discussion_r622206349



##########
File path: 
extensions/mybatis/deployment/src/main/java/org/apache/camel/quarkus/component/mybatis/deployment/MybatisProcessor.java
##########
@@ -34,13 +39,19 @@ FeatureBuildItem feature() {
         return new FeatureBuildItem(FEATURE);
     }
 
-    /**
-     * Remove this once this extension starts supporting the native mode.
-     */
-    @BuildStep(onlyIf = NativeBuild.class)
-    @Record(value = ExecutionTime.RUNTIME_INIT)
-    void warnJvmInNative(JvmOnlyRecorder recorder) {
-        JvmOnlyRecorder.warnJvmInNative(LOG, FEATURE); // warn at build time
-        recorder.warnJvmInNative(FEATURE); // warn at runtime
+    @Record(ExecutionTime.STATIC_INIT)
+    @BuildStep
+    CamelBeanBuildItem mybatisComponent(
+            List<SqlSessionFactoryBuildItem> sqlSessionFactoryBuildItem, 
CamelMyBatisRecorder recorder) {
+        return new CamelBeanBuildItem("mybatis", 
MyBatisComponent.class.getName(),
+                
recorder.createMyBatisComponent(sqlSessionFactoryBuildItem.get(0).getSqlSessionFactory()));
+    }
+
+    @Record(ExecutionTime.STATIC_INIT)
+    @BuildStep
+    CamelBeanBuildItem mybatisBeanComponent(
+            List<SqlSessionFactoryBuildItem> sqlSessionFactoryBuildItem, 
CamelMyBatisRecorder recorder) {
+        return new CamelBeanBuildItem("mybatis-bean", 
MyBatisBeanComponent.class.getName(),
+                
recorder.createMyBatisBeanComponent(sqlSessionFactoryBuildItem.get(0).getSqlSessionFactory()));

Review comment:
       sure, I create https://github.com/quarkiverse/quarkus-mybatis/issues/74 
for improving it when using mybatis xml configuration.




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to