Examples of LocalSessionFactoryBean


Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean

    assertEquals("wrong allocation percentage", Percentage.valueOf("50%"), b2.getAllocationPercentage());
  }

  private SessionFactory createTestSessionFactory() throws Exception {
    // simulate the Spring bean initialization lifecycle
    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    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();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean

        .getBenefitAvailabilityPolicy());
  }

  private SessionFactory createTestSessionFactory() throws Exception {
    // simulate the Spring bean initialization lifecycle
    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();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean

    assertEquals("wrong allocation percentage", Percentage.valueOf("50%"), b2.getAllocationPercentage());
  }

  private SessionFactory createTestSessionFactory() throws Exception {
    // simulate the Spring bean initialization lifecycle
    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    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();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean

  private SessionFactory createTestSessionFactory() throws Exception {
    // create a FactoryBean to help create a Hibernate SessionFactory
   
    //TODO 34: AnnotationSessionFactoryBean
    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    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.setHibernateProperties(createHibernateProperties());
    // initialize according to the Spring InitializingBean contract
    factoryBean.afterPropertiesSet();
    // get the created session factory
    return (SessionFactory) factoryBean.getObject();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean

    transactionManager.rollback(transactionStatus);
  }

  private SessionFactory createTestSessionFactory() throws Exception {
    // create a FactoryBean to help create a Hibernate SessionFactory
    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    factoryBean.setDataSource(createTestDataSource());
    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();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean

    transactionManager.rollback(transactionStatus);
  }

  private SessionFactory createTestSessionFactory() throws Exception {
    // create a FactoryBean to help create a Hibernate SessionFactory
    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    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.setHibernateProperties(createHibernateProperties());
    // initialize according to the Spring InitializingBean contract
    factoryBean.afterPropertiesSet();
    // get the created session factory
    return (SessionFactory) factoryBean.getObject();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate4.LocalSessionFactoryBean

  /* private helper methods */

  @SuppressWarnings("cast")
  private SessionFactory getSessionFactory(DataSource dataSource) throws Exception {
    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();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate4.LocalSessionFactoryBean

    initializer.setDatabasePopulator(databasePopulator);
    initializer.afterPropertiesSet();
  }

  private SessionFactory getSessionFactory(DataSource dataSource) throws Exception {
    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 factory.getObject();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate4.LocalSessionFactoryBean

    }
  }

  @SuppressWarnings("cast")
  private SessionFactory getSessionFactory(DataSource dataSource) throws Exception {
    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();
  }
View Full Code Here

Examples of org.springframework.orm.hibernate4.LocalSessionFactoryBean

        // init SessionFactoryWrapper
        sessionFactoryWrapper = new SessionFactoryWrapper();

        try {
            // init LocalSessionFactoryBean
            localSessionFactoryBean = new LocalSessionFactoryBean();
            localSessionFactoryBean.setDataSource(dataSource);
            localSessionFactoryBean.setHibernateProperties(hibernateProperties);
            localSessionFactoryBean.setPackagesToScan(packagesToScan);

            localSessionFactoryBean.afterPropertiesSet();
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.