org.apache.camel.component.jpa.JpaComponentConfigurer Maven / Gradle / Ivy
/* Generated by org.apache.camel:apt */
package org.apache.camel.component.jpa;
import java.util.HashMap;
import java.util.Map;
import org.apache.camel.CamelContext;
import org.apache.camel.spi.GeneratedPropertyConfigurer;
import org.apache.camel.support.component.PropertyConfigurerSupport;
/**
* Source code generated by org.apache.camel:apt
*/
@SuppressWarnings("unchecked")
public class JpaComponentConfigurer extends PropertyConfigurerSupport implements GeneratedPropertyConfigurer {
@Override
public boolean configure(CamelContext camelContext, Object component, String name, Object value, boolean ignoreCase) {
if (ignoreCase) {
return doConfigureIgnoreCase(camelContext, component, name, value);
} else {
return doConfigure(camelContext, component, name, value);
}
}
private static boolean doConfigure(CamelContext camelContext, Object component, String name, Object value) {
switch (name) {
case "entityManagerFactory": ((JpaComponent) component).setEntityManagerFactory(property(camelContext, javax.persistence.EntityManagerFactory.class, value)); return true;
case "transactionManager": ((JpaComponent) component).setTransactionManager(property(camelContext, org.springframework.transaction.PlatformTransactionManager.class, value)); return true;
case "joinTransaction": ((JpaComponent) component).setJoinTransaction(property(camelContext, boolean.class, value)); return true;
case "sharedEntityManager": ((JpaComponent) component).setSharedEntityManager(property(camelContext, boolean.class, value)); return true;
case "basicPropertyBinding": ((JpaComponent) component).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
case "lazyStartProducer": ((JpaComponent) component).setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "bridgeErrorHandler": ((JpaComponent) component).setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
default: return false;
}
}
private static boolean doConfigureIgnoreCase(CamelContext camelContext, Object component, String name, Object value) {
switch (name.toLowerCase()) {
case "entitymanagerfactory": ((JpaComponent) component).setEntityManagerFactory(property(camelContext, javax.persistence.EntityManagerFactory.class, value)); return true;
case "transactionmanager": ((JpaComponent) component).setTransactionManager(property(camelContext, org.springframework.transaction.PlatformTransactionManager.class, value)); return true;
case "jointransaction": ((JpaComponent) component).setJoinTransaction(property(camelContext, boolean.class, value)); return true;
case "sharedentitymanager": ((JpaComponent) component).setSharedEntityManager(property(camelContext, boolean.class, value)); return true;
case "basicpropertybinding": ((JpaComponent) component).setBasicPropertyBinding(property(camelContext, boolean.class, value)); return true;
case "lazystartproducer": ((JpaComponent) component).setLazyStartProducer(property(camelContext, boolean.class, value)); return true;
case "bridgeerrorhandler": ((JpaComponent) component).setBridgeErrorHandler(property(camelContext, boolean.class, value)); return true;
default: return false;
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy