Example usage for org.hibernate.boot MetadataSources addFile

List of usage examples for org.hibernate.boot MetadataSources addFile

Introduction

In this page you can find the example usage for org.hibernate.boot MetadataSources addFile.

Prototype

public MetadataSources addFile(File file) 

Source Link

Document

Read mappings from a particular XML file

Usage

From source file:org.teiid.spring.autoconfigure.SchemaBuilderUtility.java

License:Apache License

public void generateVBLSchema(ApplicationContext context, MetadataFactory source, MetadataFactory target,
        Dialect dialect, MetadataSources metadataSources) {
    generateVBLSchema(source, target);/*from   w  w w.  java2  s .  co m*/
    StandardServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder(
            (BootstrapServiceRegistry) metadataSources.getServiceRegistry())
                    .applySetting(AvailableSettings.DIALECT, dialect).build();
    ArtifactCollector files = generateHibernateModel(source, serviceRegistry);
    for (File f : files.getFiles("hbm.xml")) {
        metadataSources.addFile(f);
    }
}