gnodet-bot commented on code in PR #27935:
URL: https://github.com/apache/camel/pull/27935#discussion_r4292962227


##########
bom/camel-bom/pom.xml:
##########
@@ -1107,6 +1107,11 @@
         <artifactId>camel-health</artifactId>
         <version>4.24.0-SNAPSHOT</version>
       </dependency>
+      <dependency>
+        <groupId>org.apache.camel</groupId>
+        <artifactId>camel-hibernate</artifactId>
+        <version>4.23.0-SNAPSHOT</version>

Review Comment:
   ⚠️ **BOM version mismatch — build-breaking**
   
   `camel-hibernate` is added with hardcoded `4.23.0-SNAPSHOT` while the 
current branch is `4.24.0-SNAPSHOT`. Every surrounding BOM entry uses 
`4.24.0-SNAPSHOT`. This will cause consumers resolving from the BOM to pull a 
version that doesn't exist, breaking builds.
   
   ```suggestion
           <version>4.24.0-SNAPSHOT</version>
   ```



##########
components/camel-hibernate/src/main/java/org/apache/camel/component/hibernate/HibernateComponent.java:
##########
@@ -0,0 +1,243 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.camel.component.hibernate;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import javax.sql.DataSource;
+
+import org.apache.camel.Endpoint;
+import org.apache.camel.RuntimeCamelException;
+import org.apache.camel.spi.Metadata;
+import org.apache.camel.spi.annotations.Component;
+import org.apache.camel.support.DefaultComponent;
+import org.hibernate.SessionFactory;
+import org.hibernate.boot.MetadataSources;
+import org.hibernate.boot.registry.StandardServiceRegistry;
+import org.hibernate.boot.registry.StandardServiceRegistryBuilder;
+import org.hibernate.cfg.AvailableSettings;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+@Component("hibernate")
+public class HibernateComponent extends DefaultComponent {
+
+    private static final Logger LOG = 
LoggerFactory.getLogger(HibernateComponent.class);
+
+    @Metadata(description = "The Hibernate SessionFactory to use.")
+    private SessionFactory sessionFactory;
+
+    @Metadata(description = "The DataSource to use for bootstrapping the 
SessionFactory (bean reference or registry name).")
+    private Object dataSource;
+
+    private Class<?>[] entityClasses;
+
+    @Metadata(description = "Schema generation action: none, validate, update, 
create.", defaultValue = "none")

Review Comment:
   ⚠️ **`@Metadata` description is out of date**
   
   The description still lists only `none, validate, update, create` but 
`validateSchemaAction()` now accepts 7 values (`create-drop`, `create-only`, 
`drop` were added). The generated catalog JSON inherits this incomplete 
description, so tooling (IDE completion, camel-catalog) will present wrong 
values to users.
   
   ```suggestion
       @Metadata(description = "Schema generation action: none, validate, 
update, create, create-drop, create-only, drop.", defaultValue = "none")
   ```
   
   Also update `hibernate-component.adoc` lines 92-95 to list all 7 supported 
values.



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