jeejz commented on code in PR #2298:
URL: 
https://github.com/apache/incubator-kie-kogito-apps/pull/2298#discussion_r2825722537


##########
data-audit/kogito-addons-data-audit-springboot/src/main/java/org/kie/kogito/app/audit/springboot/SpringbootAuditDataConfiguration.java:
##########
@@ -18,13 +18,32 @@
  */
 package org.kie.kogito.app.audit.springboot;
 
+import org.springframework.beans.factory.config.BeanPostProcessor;
 import org.springframework.boot.SpringBootConfiguration;
 import org.springframework.boot.autoconfigure.EnableAutoConfiguration;
+import org.springframework.context.annotation.Bean;
 import org.springframework.context.annotation.ComponentScan;
+import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
 
 @SpringBootConfiguration
 @EnableAutoConfiguration
 @ComponentScan
 public class SpringbootAuditDataConfiguration {
 
+    // Hibernate 7 + Spring ORM 6.2 workaround: Hibernate 7's 
SessionFactory.getSchemaManager()
+    // returns org.hibernate.relational.SchemaManager, conflicting with JPA 
3.2's
+    // EntityManagerFactory.getSchemaManager() returning 
jakarta.persistence.SchemaManager.
+    // Force plain JPA interface to avoid JDK Proxy incompatible return type 
error.
+    @Bean
+    public static BeanPostProcessor 
entityManagerFactoryInterfacePostProcessor() {
+        return new BeanPostProcessor() {
+            @Override
+            public Object postProcessBeforeInitialization(Object bean, String 
beanName) {
+                if (bean instanceof LocalContainerEntityManagerFactoryBean 
emfb) {

Review Comment:
   this is addressed, by changing the names of methods. and added the same 
config for data index as well



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to