Package org.springframework.orm.jpa

Examples of org.springframework.orm.jpa.JpaTemplate


     * @param _entityManager entity manager
     */
    @PersistenceContext
    public final void setEntityManager(EntityManager entityManager) {
        _entityManager = entityManager;
        _jpaTemplate = new JpaTemplate(_entityManager);
    }
View Full Code Here


        _entityManager = entityManager;
        _jpaTemplate = new JpaTemplate(_entityManager);
    }

    public final void setEntityManagerFactory(EntityManagerFactory entityManagerFactory) {
        _jpaTemplate = new JpaTemplate(entityManagerFactory);       
    }
View Full Code Here

   * @param entityManagerFactory the JPA EntityManagerFactory to create a JpaTemplate for
   * @return the new JpaTemplate instance
   * @see #setEntityManagerFactory
   */
  protected JpaTemplate createJpaTemplate(EntityManagerFactory entityManagerFactory) {
    return new JpaTemplate(entityManagerFactory);
  }
View Full Code Here

   * @param entityManager the JPA EntityManager to create a JpaTemplate for
   * @return the new JpaTemplate instance
   * @see #setEntityManagerFactory
   */
  protected JpaTemplate createJpaTemplate(EntityManager entityManager) {
    return new JpaTemplate(entityManager);
  }
View Full Code Here

    }

    // Implementation methods
    // -------------------------------------------------------------------------
    protected JpaTemplate createTemplate() {
        return new JpaTemplate(getEntityManagerFactory());
    }
View Full Code Here

        overdueEndpoint = getMockEndpoint("mock:overdue");
        overdueEndpoint.setResultWaitTime(8000);
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        JpaTemplate jpaTemplate = getMandatoryBean(JpaTemplate.class, "jpaTemplate");
        TransactionTemplate transactionTemplate = getMandatoryBean(TransactionTemplate.class, "transactionTemplate");

        // START SNIPPET: example
        return new ProcessBuilder(jpaTemplate, transactionTemplate) {
            public void configure() throws Exception {
View Full Code Here

    assertEquals("initDao not called", test.size(), 1);
    mockControl.verify();
  }

  public void testJpaDaoSupportWithJpaTemplate() throws Exception {
    JpaTemplate template = new JpaTemplate();
    final List test = new ArrayList();
    JpaDaoSupport dao = new JpaDaoSupport() {
      protected void initDao() {
        test.add("test");
      }
View Full Code Here

    factoryControl = MockControl.createControl(EntityManagerFactory.class);
    factory = (EntityManagerFactory) factoryControl.getMock();
    managerControl = MockControl.createControl(EntityManager.class);
    manager = (EntityManager) managerControl.getMock();

    template = new JpaTemplate(factory);
    template.afterPropertiesSet();

    factoryControl.expectAndReturn(factory.createEntityManager(), manager);
  }
View Full Code Here

    populateDataBase(dataSource);
    jdbcTemplate = new JdbcTemplate(dataSource);
    entityManagerFactory = getEntityManagerFactory(dataSource);
    JpaTransactionManager tm = new JpaTransactionManager(entityManagerFactory);
    jpaListener = new JpaFlowExecutionListener(entityManagerFactory, tm);
    jpaTemplate = new JpaTemplate(entityManagerFactory);
  }
View Full Code Here

     * entity
     * @throws Exception
     */
    @Converter
    public CustomerEntity toCustomer(PersonDocument doc, Exchange exchange) throws Exception {
        JpaTemplate template = exchange.getIn().getHeader("CamelJpaTemplate", JpaTemplate.class);

       
        String user = doc.getUser();
        CustomerEntity customer = findCustomerByName(template, user);

View Full Code Here

TOP

Related Classes of org.springframework.orm.jpa.JpaTemplate

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.