Package org.springframework.orm.hibernate3

Examples of org.springframework.orm.hibernate3.LocalSessionFactoryBean


      if (hibernateTemplate != null)
        logger.debug("hibernateTemplate present - jBPM persistence service will be managed by Spring");
      else {
        if (dummy.getSessionFactory() != null) {
          logger.debug("creating hibernateTemplate based on jBPM SessionFactory");
          hibernateTemplate = new HibernateTemplate(dummy.getSessionFactory());
        }
        else

          logger.debug("hibernateTemplate missing - jBPM will handle its own persistence");
      }
View Full Code Here


   */
  public void afterPropertiesSet() {
    if (jbpmSessionFactory == null)
      throw new IllegalArgumentException("jbpmSessionFactory must be set");
    // init the hbTemplate that will be used to prepare and handle the HB Session
    hibernateTemplate = new HibernateTemplate(jbpmSessionFactory.getSessionFactory());
    hibernateTemplate.setAllowCreate(allowCreate);
  }
View Full Code Here

    public Object postProcessAfterInitialization(Object bean, String beanName)
            throws BeansException {

        if ("sessionFactory".equals(beanName) && bean instanceof LocalSessionFactoryBean) {
            try {
                LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean) bean;

                Configuration cfg = new Configuration();
                cfg.configure();

                // load all mappings
View Full Code Here

  public static void main(String[] args)
  {
    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(
      "database/spring/applicationContext.xml");

    LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean) appContext
      .getBean("&sessionFactory", LocalSessionFactoryBean.class);

    sessionFactory.createDatabaseSchema();
 
View Full Code Here

  public static void main(String[] args)
  {
    FileSystemXmlApplicationContext appContext = new FileSystemXmlApplicationContext(
        "database/spring/applicationContext.xml");
   
    LocalSessionFactoryBean sessionFactory = (LocalSessionFactoryBean) appContext
        .getBean("&sessionFactory", LocalSessionFactoryBean.class);
   
    sessionFactory.updateDatabaseSchema()
 
View Full Code Here

      }
    }
  }

  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

      }
    }
  }

  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

        springProcessEngine = new JBPMSpringProcessEngine();
        springProcessEngine.applicationContext = applicationContext;
        springProcessEngine.initializeProcessEngine(configuration);

        // prefixing session factory bean name with "&" to get the factory
        LocalSessionFactoryBean localSessionFactoryBean = sessionFactoryName != null ? (LocalSessionFactoryBean) springProcessEngine
                .get("&" + sessionFactoryName) : springProcessEngine
                .get(LocalSessionFactoryBean.class);
        Configuration hibernateConfiguration = localSessionFactoryBean.getConfiguration();
        springProcessEngine.processEngineWireContext
            .getWireDefinition()
            .addDescriptor(new ProvidedObjectDescriptor(hibernateConfiguration, true));

        springProcessEngine.checkDb(configuration);
View Full Code Here

      springProcessEngine = new SpringProcessEngine();
      springProcessEngine.applicationContext = applicationContext;
      springProcessEngine.initializeProcessEngine(configuration);

      LocalSessionFactoryBean localSessionFactoryBean = springProcessEngine.get(LocalSessionFactoryBean.class);
      Configuration hibernateConfiguration = localSessionFactoryBean.getConfiguration();
      springProcessEngine.processEngineWireContext
          .getWireDefinition()
          .addDescriptor(new ProvidedObjectDescriptor(hibernateConfiguration, true));
     
      springProcessEngine.checkDb(configuration);
View Full Code Here

  }

  public void afterPropertiesSet() throws Exception {

    // setup database
    LocalSessionFactoryBean sessionFactoryBean = findSessionFactoryBean(context);
    sessionFactoryBean.createDatabaseSchema();

    Session session = null;
    Transaction tx = null;
   
    try {
View Full Code Here

TOP

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

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.