Package org.springframework.orm.hibernate4

Examples of org.springframework.orm.hibernate4.HibernateTemplateTests


   * @param sessionFactory the Hibernate SessionFactory to create a HibernateTemplate for
   * @return the new HibernateTemplate instance
   * @see #setSessionFactory
   */
  protected HibernateTemplate createHibernateTemplate(SessionFactory sessionFactory) {
    return new HibernateTemplate(sessionFactory);
  }
View Full Code Here


    };
  }

  @Test(dataProvider = "invalids", expectedExceptions = SpecificationViolationException.class)
  public void testInvalids(final Class<?> klass) {
    final HibernateDaoFactoryBean bean = new HibernateDaoFactoryBean(klass, Book.class, new HibernateTransactionManager(), sessionFactory);
    bean.afterPropertiesSet();
  }
View Full Code Here

    bean.afterPropertiesSet();
  }

  @Test(dataProvider = "valids")
  public void testValids(final Class<? extends FinderExecutor> klass) {
    final HibernateDaoFactoryBean bean = new HibernateDaoFactoryBean(klass, Book.class, new HibernateTransactionManager(), sessionFactory);
    bean.afterPropertiesSet();
    assert klass.isInstance(bean.getObject());
  }
View Full Code Here

  private SessionFactory sessionFactory;

  @Override
  protected FlowExecutionListener createFlowExecutionListener() throws Exception {
    sessionFactory = getSessionFactory(getDataSource());
    HibernateTransactionManager tm = new HibernateTransactionManager(sessionFactory);
    return new HibernateFlowExecutionListener(sessionFactory, tm);
  }
View Full Code Here

  @Bean
  @DependsOn("sessionFactory")
  public PlatformTransactionManager transactionManager(
      SessionFactory sessionFactory) {
    return new HibernateTransactionManager(sessionFactory);
  }
View Full Code Here

    populateDataBase(dataSource);
    jdbcTemplate = new JdbcTemplate(dataSource);
    sessionFactory = getSessionFactory(dataSource);
    hibernateTemplate = new HibernateTemplate(sessionFactory);
    hibernateTemplate.setCheckWriteOperations(false);
    HibernateTransactionManager tm = new HibernateTransactionManager(sessionFactory);
    hibernateListener = new HibernateFlowExecutionListener(sessionFactory, tm);
  }
View Full Code Here

  @Override
  protected void setUpResources(DataSource dataSource) throws Exception {
    sessionFactory = getSessionFactory(dataSource);
    hibernateTemplate = new HibernateTemplate(sessionFactory);
    hibernateTemplate.setCheckWriteOperations(false);
    HibernateTransactionManager tm = new HibernateTransactionManager(sessionFactory);
    executionListener = new HibernateFlowExecutionListener(sessionFactory, tm);
    rowCount = 1;
  }
View Full Code Here

            .buildSessionFactory();
    }

    @Bean
    public PlatformTransactionManager transactionManager() throws Exception {
        return new HibernateTransactionManager(sessionFactory());
    }
View Full Code Here

  @Bean
  @Autowired
  @DependsOn("sessionFactory")
  public PlatformTransactionManager transactionManager(
      SessionFactory sessionFactory) {
    return new HibernateTransactionManager(sessionFactory);
  }
View Full Code Here

    }

    @Autowired
    @Bean(name = "transactionManager")
    public HibernateTransactionManager getTransactionManager(SessionFactory sessionFactory) {
        HibernateTransactionManager transactionManager = new HibernateTransactionManager(sessionFactory);
        return transactionManager;
    }
View Full Code Here

TOP

Related Classes of org.springframework.orm.hibernate4.HibernateTemplateTests

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.