Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.HibernateTransactionManager


  public void setUp() throws Exception  {
    // setup the repository to test
    SessionFactory sessionFactory = createTestSessionFactory();
    repository = new HibernateAccountRepository(sessionFactory);
    // begin a transaction
    transactionManager = new HibernateTransactionManager(sessionFactory);
    transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
  }
View Full Code Here


  public void setUp() throws Exception {
    // setup the repository to test
    SessionFactory sessionFactory = createTestSessionFactory();
    repository = new HibernateRestaurantRepository(sessionFactory);
    // begin a transaction
    transactionManager = new HibernateTransactionManager(sessionFactory);
    transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
  }
View Full Code Here

  public void setUp() throws Exception {
    // setup the repository to test
    SessionFactory sessionFactory = createTestSessionFactory();
    repository = new HibernateRestaurantRepository(sessionFactory);
    // begin a transaction
    transactionManager = new HibernateTransactionManager(sessionFactory);
    transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
  }
View Full Code Here

  public void setUp() throws Exception  {
    // setup the repository to test
    SessionFactory sessionFactory = createTestSessionFactory();
    repository = new HibernateAccountRepository(sessionFactory);
    // begin a transaction
    transactionManager = new HibernateTransactionManager(sessionFactory);
    transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
  }
View Full Code Here

  public void setUp() throws Exception {
    // setup the repository to test
    SessionFactory sessionFactory = createTestSessionFactory();
    repository = new HibernateRestaurantRepository(sessionFactory);
    // begin a transaction
    transactionManager = new HibernateTransactionManager(sessionFactory);
    transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
  }
View Full Code Here

  public void setUp() throws Exception  {
    // setup the repository to test
    SessionFactory sessionFactory = createTestSessionFactory();
    repository = new HibernateAccountRepository(sessionFactory);
    // begin a transaction
    transactionManager = new HibernateTransactionManager(sessionFactory);
    transactionStatus = transactionManager.getTransaction(new DefaultTransactionDefinition());
  }
View Full Code Here

    public void setUp() throws Exception {
        dataSource = new DriverManagerDataSource("jdbc:h2:mem:hibernate;DB_CLOSE_DELAY=-1", "sa", "sa");

        System.setProperty("hibernate.dialect", H2Dialect.class.getName());
        System.setProperty("hibernate.hbm2ddl.auto", "create-drop");
        AnnotationSessionFactoryBean sessionFactory = new AnnotationSessionFactoryBean();
        sessionFactory.setDataSource(dataSource);
        sessionFactory.setAnnotatedClasses(new Class[] {PhotoSpot.class});
        sessionFactory.afterPropertiesSet();

        repo.hibernate = new HibernateTemplate(sessionFactory.getObject());
    }
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

TOP

Related Classes of org.springframework.orm.hibernate3.HibernateTransactionManager

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.