Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean.afterPropertiesSet()


    LocalSessionFactoryBean factory = new LocalSessionFactoryBean();
    factory.setDataSource(dataSource);
    factory.setMappingLocations(new Resource[] {
        new ClassPathResource("org/springframework/webflow/persistence/TestBean.hbm.xml"),
        new ClassPathResource("org/springframework/webflow/persistence/TestAddress.hbm.xml") });
    factory.afterPropertiesSet();
    return (SessionFactory) factory.getObject();
  }

  private void assertSessionBound() {
    assertNotNull(TransactionSynchronizationManager.getResource(sessionFactory));
View Full Code Here


    LocalSessionFactoryBean factory = new LocalSessionFactoryBean();
    factory.setDataSource(dataSource);
    factory.setMappingLocations(new Resource[] {
        new ClassPathResource("org/springframework/webflow/persistence/TestBean.hbm.xml"),
        new ClassPathResource("org/springframework/webflow/persistence/TestAddress.hbm.xml") });
    factory.afterPropertiesSet();
    return (SessionFactory) factory.getObject();
  }

  private void assertSessionNotBound() {
    assertNull(TransactionSynchronizationManager.getResource(sessionFactory));
View Full Code Here

      }
      factory.setHibernateProperties(props);
      factory.setLobHandler(dialect.getLobHandler());
    }
    try {
      factory.afterPropertiesSet();
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    }
    return factory.getObject();
  }
View Full Code Here

      props.setProperty(Environment.TRANSACTION_STRATEGY, "org.hibernate.transaction.JDBCTransactionFactory");
    }
    factory.setHibernateProperties(props);
    factory.setLobHandler(dialect.getLobHandler());
    try {
      factory.afterPropertiesSet();
    } catch (Exception ex) {
      throw new RuntimeException(ex);
    }
    return factory.getObject();
  }
View Full Code Here

        new ClassPathResource("Account.hbm.xml", HibernateAccountManager.class),
        new ClassPathResource("Beneficiary.hbm.xml", HibernateAccountManager.class) };
    factoryBean.setMappingLocations(mappingLocations);
    factoryBean.setHibernateProperties(createHibernateProperties());
    // initialize according to the Spring InitializingBean contract
    factoryBean.afterPropertiesSet();
    // get the created session factory
    return (SessionFactory) factoryBean.getObject();
  }

  private DataSource createTestDataSource() {
View Full Code Here

    factoryBean.setDataSource(createTestDataSource());
    Resource[] mappingLocations = new ClassPathResource[] {
        new ClassPathResource("Account.hbm.xml", Account.class),
        new ClassPathResource("Beneficiary.hbm.xml", Beneficiary.class) };
    factoryBean.setMappingLocations(mappingLocations);
    factoryBean.afterPropertiesSet();
    return (SessionFactory) factoryBean.getObject();
  }

  private DataSource createTestDataSource() {
    Resource schemaLocation = new ClassPathResource("/rewards/testdb/schema.sql");
View Full Code Here

    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    factoryBean.setDataSource(createTestDataSource());
    Resource[] mappingLocations = new ClassPathResource[] { new ClassPathResource("Restaurant.hbm.xml",
        Restaurant.class) };
    factoryBean.setMappingLocations(mappingLocations);
    factoryBean.afterPropertiesSet();
    return (SessionFactory) factoryBean.getObject();
  }

  private DataSource createTestDataSource() {
    Resource schemaLocation = new ClassPathResource("/rewards/testdb/schema.sql");
View Full Code Here

    Resource[] mappingLocations = new ClassPathResource[] { new ClassPathResource("Restaurant.hbm.xml",
        Restaurant.class) };
    factoryBean.setMappingLocations(mappingLocations);
    factoryBean.setHibernateProperties(createHibernateProperties());
    // initialize according to the Spring InitializingBean contract
    factoryBean.afterPropertiesSet();
    // get the created session factory
    return (SessionFactory) factoryBean.getObject();
  }

  private DataSource createTestDataSource() {
View Full Code Here

        new ClassPathResource("Account.hbm.xml", Account.class),
        new ClassPathResource("Beneficiary.hbm.xml", Beneficiary.class) };
    factoryBean.setMappingLocations(mappingLocations);
    factoryBean.setHibernateProperties(createHibernateProperties());
    // initialize according to the Spring InitializingBean contract
    factoryBean.afterPropertiesSet();
    // get the created session factory
    return (SessionFactory) factoryBean.getObject();
  }

  private DataSource createTestDataSource() {
View Full Code Here

        new ClassPathResource("Account.hbm.xml", Account.class),
        new ClassPathResource("Beneficiary.hbm.xml", Beneficiary.class) };
    factoryBean.setMappingLocations(mappingLocations);
    factoryBean.setHibernateProperties(createHibernateProperties());
    // initialize according to the Spring InitializingBean contract
    factoryBean.afterPropertiesSet();
    // get the created session factory
    return (SessionFactory) factoryBean.getObject();
  }

  private DataSource createTestDataSource() {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.