Package org.hibernate.cfg

Examples of org.hibernate.cfg.Configuration.configure()


  @Override
  public void loadConfiguration() throws SessionFactoryConfigurationException {
    try {     
      Configuration config = new Configuration();
      config.configure();
      String batchSize = config.getProperty("hibernate.jdbc.batch_size");
      if(logger.isDebugEnabled()) {
        StringBuffer log = new StringBuffer();
        log.append("hibernate.jdbc.batch_size: ").append(batchSize);
        logger.debug(log.toString());
View Full Code Here


      }

      if (this.configLocations != null) {
        for (int i = 0; i < this.configLocations.length; i++) {
          // Load Hibernate configuration from given location.
          config.configure(this.configLocations[i].getURL());
        }
      }

      if (this.hibernateProperties != null) {
        // Add given Hibernate properties to Configuration.
View Full Code Here

      }

      if (this.configLocations != null) {
        for (int i = 0; i < this.configLocations.length; i++) {
          // Load Hibernate configuration from given location.
          config.configure(this.configLocations[i].getURL());
        }
      }

      if (this.hibernateProperties != null) {
        // Add given Hibernate properties to Configuration.
View Full Code Here

      }

      if (this.configLocations != null) {
        for (int i = 0; i < this.configLocations.length; i++) {
          // Load Hibernate configuration from given location.
          config.configure(this.configLocations[i].getURL());
        }
      }

      if (this.hibernateProperties != null) {
        // Add given Hibernate properties to Configuration.
View Full Code Here

    annotationConfiguration.addAnnotatedClass(UrunlerExtraDAO.class);
    annotationConfiguration.configure("hibernate.cfg.xml");
  //  new SchemaExport(annotationConfiguration).create(true,true);
   
    Configuration configuration = new Configuration();
    configuration.configure();
    sessionFactory = configuration.buildSessionFactory();
    return sessionFactory;
  }
}
View Full Code Here

                    "true");
            configuration.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
            configuration.setProperty(Environment.DATASOURCE, "java:jboss/datasources/ExampleDS");
            // fetch the properties
            Properties properties = new Properties();
            configuration = configuration.configure("hibernate.cfg.xml");
            properties.putAll(configuration.getProperties());
            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);

            // build the serviceregistry
View Full Code Here

            configuration.getProperties().put(AvailableSettings.JTA_PLATFORM, JBossAppServerJtaPlatform.class);
            configuration.setProperty(Environment.HBM2DDL_AUTO, "create-drop");
            configuration.setProperty(Environment.DATASOURCE, "java:jboss/datasources/ExampleDS");
            // fetch the properties
            Properties properties = new Properties();
            configuration = configuration.configure("hibernate.cfg.xml");
            properties.putAll(configuration.getProperties());
            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);

            // build the serviceregistry
View Full Code Here

            configuration.setProperty(Environment.DATASOURCE, "java:jboss/datasources/ExampleDS");
            configuration.setProperty("hibernate.listeners.envers.autoRegister", "false");

            // fetch the properties
            Properties properties = new Properties();
            configuration = configuration.configure("hibernate.cfg.xml");
            properties.putAll(configuration.getProperties());

            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);
View Full Code Here

            configuration.setProperty(Environment.DATASOURCE, "java:jboss/datasources/ExampleDS");
            configuration.setProperty("hibernate.listeners.envers.autoRegister", "false");

            // fetch the properties
            Properties properties = new Properties();
            configuration = configuration.configure("hibernate.cfg.xml");
            properties.putAll(configuration.getProperties());

            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);
View Full Code Here

            configuration.setProperty(Environment.DATASOURCE, "java:jboss/datasources/ExampleDS");
            configuration.setProperty("hibernate.listeners.envers.autoRegister", "false");

            // fetch the properties
            Properties properties = new Properties();
            configuration = configuration.configure("hibernate.cfg.xml");
            properties.putAll(configuration.getProperties());

            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);
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.