Java 类org.apache.camel.component.jpa.JpaEndpoint 实例源码

项目:Camel    文件:JpaRouteEndpointTest.java   
@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");
        }
    };
}
项目:camelinaction2    文件:JpaTest.java   
private void assertEntityInDB() throws Exception {
    JpaEndpoint endpoint = context.getEndpoint("jpa:camelinaction.PurchaseOrder", JpaEndpoint.class);
    EntityManager em = endpoint.getEntityManagerFactory().createEntityManager();

    List list = em.createQuery("select x from camelinaction.PurchaseOrder x").getResultList();
    assertEquals(1, list.size());

    assertIsInstanceOf(PurchaseOrder.class, list.get(0));

    em.close();
}
项目:camelinaction    文件:JpaTest.java   
@SuppressWarnings("unchecked")
private void assertEntityInDB() throws Exception {
       JpaEndpoint endpoint = (JpaEndpoint) context.getEndpoint("jpa:camelinaction.PurchaseOrder");        
       EntityManager em = endpoint.getEntityManagerFactory().createEntityManager();

       List list = em.createQuery("select x from camelinaction.PurchaseOrder x").getResultList();
       assertEquals(1, list.size());

       assertIsInstanceOf(PurchaseOrder.class, list.get(0));

       em.close();
   }
项目:t4f-data    文件:JpaTest.java   
@SuppressWarnings("unchecked")
private void assertEntityInDB() throws Exception {
       JpaEndpoint endpoint = (JpaEndpoint) context.getEndpoint("jpa:camelinaction.PurchaseOrder");        
       jpaTemplate = endpoint.getTemplate();

       List list = jpaTemplate.find("select x from camelinaction.PurchaseOrder x");
       assertEquals(1, list.size());

       assertIsInstanceOf(PurchaseOrderImmutable.class, list.get(0));
   }
项目:switchyard    文件:V1CamelJpaBindingModelTest.java   
public V1CamelJpaBindingModelTest() {
    super(JpaEndpoint.class, CAMEL_XML);

    setSkipCamelEndpointTesting(true);
}
项目:switchyard    文件:V1CamelJpaConsumerBindingModelTest.java   
public V1CamelJpaConsumerBindingModelTest() {
    super(JpaEndpoint.class, CAMEL_XML);

    setSkipCamelEndpointTesting(true);
}
项目:switchyard    文件:V1CamelJpaProducerBindingModelTest.java   
public V1CamelJpaProducerBindingModelTest() {
    super(JpaEndpoint.class, CAMEL_XML);

    setSkipCamelEndpointTesting(true);
}