Example usage for org.hibernate.boot.registry StandardServiceRegistryBuilder loadProperties

List of usage examples for org.hibernate.boot.registry StandardServiceRegistryBuilder loadProperties

Introduction

In this page you can find the example usage for org.hibernate.boot.registry StandardServiceRegistryBuilder loadProperties.

Prototype

@SuppressWarnings({ "unchecked" })
public StandardServiceRegistryBuilder loadProperties(File file) 

Source Link

Document

Read settings from a java.util.Properties file by File reference

Differs from #configure() and #configure(String) in that here we expect to read a java.util.Properties file while for #configure we read the XML variant.

Usage

From source file:org.glite.security.voms.admin.persistence.deployer.SchemaDeployer.java

License:Apache License

private MetadataSources getHibernateMetadataSources() {

    StandardServiceRegistryBuilder registryBuilder = new StandardServiceRegistryBuilder();

    if (hibernatePropertiesFile == null) {
        registryBuilder.loadProperties(new File(getHibernateConfigurationFile(vo)));
    } else {//ww  w.j ava2s .  co m
        registryBuilder.loadProperties(new File(hibernatePropertiesFile));
    }
    registryBuilder.configure();
    MetadataSources sources = new MetadataSources(registryBuilder.build());
    return sources;
}