Package org.springframework.orm.hibernate4

Examples of org.springframework.orm.hibernate4.HibernateTemplate


     * Hibernate 에외를 변환하는 {@link org.springframework.orm.hibernate4.HibernateExceptionTranslator} 를 Spring 의 ApplicationContext에 등록합니다.
     */
    // NOTE: 이거 꼭 정의해야 합니다.
    @Bean
    public HibernateExceptionTranslator hibernateExceptionTranslator() {
        return new HibernateExceptionTranslator();
    }
View Full Code Here


    }

    @Bean
    public HibernateExceptionTranslator hibernateExceptionTranslator()
    {
        return new HibernateExceptionTranslator();
    }
View Full Code Here

    }

    // Exception Translation
    @Bean
    public HibernateExceptionTranslator exceptionTranslation() {
        return new HibernateExceptionTranslator();
    }
View Full Code Here

  protected void setUp() throws Exception {
    DataSource dataSource = getDataSource();
    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

  private int rowCount;

  @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

   * @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

TOP

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

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.