Package org.springframework.orm.hibernate3

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


    {
        AnnotationSessionFactoryBean bean = new AnnotationSessionFactoryBean();
        bean.setDataSource(dataSource());
        bean.setPackagesToScan(new String[] {"org.springframework.issues"});
        bean.setHibernateProperties(hibernateProps());
        bean.afterPropertiesSet();
        return bean.getObject();
    }

    private Properties hibernateProps()
    {
View Full Code Here


    {
        AnnotationSessionFactoryBean bean = new AnnotationSessionFactoryBean();
        bean.setDataSource(dataSource());
        bean.setPackagesToScan(new String[] {"org.springframework.issues"});
        bean.setHibernateProperties(hibernateProps());
        bean.afterPropertiesSet();
        return bean.getObject();
    }

    private Properties hibernateProps()
    {
View Full Code Here

   
    //TODO 35: Add annotated classes

    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

    AnnotationSessionFactoryBean factoryBean = new AnnotationSessionFactoryBean();
    factoryBean.setDataSource(createTestDataSource());
    factoryBean.setAnnotatedClasses(new Class [] {Restaurant.class});
    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

    AnnotationSessionFactoryBean factoryBean = new AnnotationSessionFactoryBean();
    factoryBean.setDataSource(createTestDataSource());
    factoryBean.setAnnotatedClasses(new Class [] {Account.class, Beneficiary.class});
    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

    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

    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();
  }

  private void assertSessionNotBound() {
    assertNull(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();
  }

}
View Full Code Here

    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    factoryBean.setDataSource(dataSource);
    factoryBean.setMappingLocations(new Resource[] { new ClassPathResource("Foo.hbm.xml", getClass()) });
    customizeSessionFactory(factoryBean);
    factoryBean.afterPropertiesSet();

    SessionFactory sessionFactory = factoryBean.getObject();

    HibernatePagingItemReader<Foo> hibernateReader = new HibernatePagingItemReader<Foo>();
    setQuery(hibernateReader);
View Full Code Here

    LocalSessionFactoryBean factoryBean = new LocalSessionFactoryBean();
    factoryBean.setDataSource(dataSource);
    factoryBean.setMappingLocations(new Resource[] { new ClassPathResource(
        "Foo.hbm.xml", getClass()) });
    factoryBean.afterPropertiesSet();

    SessionFactory sessionFactory = factoryBean
        .getObject();

    reader.setQueryString(hsqlQuery);
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.