Package net.sf.hibernate.cfg

Examples of net.sf.hibernate.cfg.Configuration.buildSessionFactory()


        return _myInstance;
    }

    private WorklistDBConnector() throws HibernateException {
        Configuration cfg = new Configuration();
        _factory = cfg.buildSessionFactory();
    }


    /**
     * Executes a query over the organisation model of the YAWL system.
View Full Code Here


                cfg.addClass(au.edu.qut.yawl.admintool.model.OrgGroup.class);
                cfg.addClass(au.edu.qut.yawl.admintool.model.Position.class);
                cfg.addClass(au.edu.qut.yawl.admintool.model.HResOccupiesPosition.class);
                cfg.addClass(au.edu.qut.yawl.exceptions.Problem.class);

                factory = cfg.buildSessionFactory();

                Logger.getLogger(loggerName).debug("Validating existance of database for persistence");

                boolean createtables = false;
View Full Code Here

      Properties props = new Properties();
      props.putAll(properties);
      config.setProperties(props);

      factory = config.buildSessionFactory();

    } catch (Exception e) {
      throw new DaoException("Error configuring Hibernate.  Cause: " + e);
    }
  }
View Full Code Here

    private static Logger log = Logger.getLogger(HibernateHelper.class);

    public static void initializeHibernate() throws HibernateException {
        if (GlobalSessionFactory.get() == null) {
            Configuration cfg = initializeConfiguration();
            SessionFactory sessionFactory = cfg.buildSessionFactory();
            // XPlanner uses a custom session factory so that all sessions will be
            // automatically configured with an XPlanner-related Hibernate interceptor.
            GlobalSessionFactory.set(new XPlannerSessionFactory(sessionFactory));
        }
    }
View Full Code Here

      Properties props = new Properties();
      props.putAll(properties);
      config.setProperties(props);

      factory = config.buildSessionFactory();

    } catch (Exception e) {
      throw new DaoException("Error configuring Hibernate.  Cause: " + e);
    }
  }
View Full Code Here

            hibernateProperties.setProperty(Environment.URL, url);

            configuration = new Configuration().addProperties(hibernateProperties);

            // create a session object to the database
            sessionFactory = configuration.buildSessionFactory();
            session = sessionFactory.openSession();
            assertNotNull("Expected a session", session);

            // Inspect the assigned connection to the session from
            // the pool.
View Full Code Here

            hibernateProperties.setProperty(Environment.PROXOOL_POOL_ALIAS, alias);

            configuration = new Configuration().addProperties(hibernateProperties);

            // create a session object to the database
            sessionFactory = configuration.buildSessionFactory();
            session = sessionFactory.openSession();
            assertNotNull("Expected a session", session);

            // Inspect the assigned connection to the session from
            // the pool.
View Full Code Here

            hibernateProperties.setProperty(Environment.PROXOOL_POOL_ALIAS, alias);

            configuration = new Configuration().addProperties(hibernateProperties);

            // create a session object to the database
            sessionFactory = configuration.buildSessionFactory();
            session = sessionFactory.openSession();
            assertNotNull("Expected a session", session);

            // Inspect the assigned connection to the session from
            // the pool.
View Full Code Here

        } catch (MappingException e) {
            e.printStackTrace();
        }

        try {
            sessionFactory = cfg.buildSessionFactory();
        } catch (HibernateException e) {
            e.printStackTrace();
        }
    }
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.