Package org.apache.camel.component.jpa

Examples of org.apache.camel.component.jpa.JpaEndpoint


    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                JpaEndpoint jpa = new JpaEndpoint();
                jpa.setCamelContext(context);
                jpa.setEntityType(SendEmail.class);
                jpa.setEntityManagerFactory(context.getRegistry().lookup("entityManagerFactory", EntityManagerFactory.class));

                from("direct:start").to(jpa).to("mock:result");
            }
        };
    }
View Full Code Here


    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                JpaEndpoint jpa = new JpaEndpoint();
                jpa.setCamelContext(context);
                jpa.setEntityType(SendEmail.class);
                jpa.setEntityManagerFactory(context.getRegistry().lookup("entityManagerFactory", EntityManagerFactory.class));

                from("direct:start").to(jpa).to("mock:result");
            }
        };
    }
View Full Code Here

    @Override
    protected RouteBuilder createRouteBuilder() {
        return new SpringRouteBuilder() {
            public void configure() throws Exception {
                JpaEndpoint jpa = new JpaEndpoint();
                jpa.setCamelContext(context);
                jpa.setEntityType(SendEmail.class);
                jpa.setEntityManagerFactory(context.getRegistry().lookupByNameAndType("entityManagerFactory", EntityManagerFactory.class));

                from("direct:start").to(jpa).to("mock:result");
            }
        };
    }
View Full Code Here

    @Test
    public void testRouteJpa() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        context.startRoute("foo");
        JpaEndpoint jpa = context.getEndpoint("jpa://" + SendEmail.class.getName(), JpaEndpoint.class);
        EntityManagerFactory emf = jpa.getEntityManagerFactory();

        // The entity instance is different if it is retrieved from different EntityManager instance
        EntityManager entityManager = emf.createEntityManager();
        template.sendBody("direct:start", new SendEmail("foo@beer.org"));
        Exchange exchange = mock.getReceivedExchanges().get(0);
View Full Code Here

TOP

Related Classes of org.apache.camel.component.jpa.JpaEndpoint

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.