Search in sources :

Example 1 with ConfigurationMetadataDescriptor

use of org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor in project jbosstools-hibernate by jbosstools.

the class ServiceImpl method createExporter.

@Override
public IExporter createExporter(String exporterClassName) {
    Exporter exporter = (Exporter) Util.getInstance(exporterClassName, facadeFactory.getClassLoader());
    exporter.setMetadataDescriptor(new ConfigurationMetadataDescriptor(newDefaultConfiguration()));
    return facadeFactory.createExporter(exporter);
}
Also used : ConfigurationMetadataDescriptor(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) Exporter(org.hibernate.tool.hbm2x.Exporter) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter)

Example 2 with ConfigurationMetadataDescriptor

use of org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor in project jbosstools-hibernate by jbosstools.

the class ExporterFacadeTest method testSetConfiguration.

@Test
public void testSetConfiguration() {
    Configuration cfg = new Configuration();
    IConfiguration configuration = new AbstractConfigurationFacade(FACADE_FACTORY, cfg) {
    };
    exporterFacade.setConfiguration(configuration);
    Assert.assertEquals("setMetadataDescriptor", methodName);
    Object argument = arguments[0];
    Assert.assertTrue(argument instanceof ConfigurationMetadataDescriptor);
    ConfigurationMetadataDescriptor metadataDescriptor = (ConfigurationMetadataDescriptor) argument;
    Assert.assertSame(configuration, metadataDescriptor.getConfiguration());
}
Also used : ConfigurationMetadataDescriptor(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor) Configuration(org.hibernate.cfg.Configuration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) AbstractConfigurationFacade(org.jboss.tools.hibernate.runtime.common.AbstractConfigurationFacade) Test(org.junit.Test)

Example 3 with ConfigurationMetadataDescriptor

use of org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor in project jbosstools-hibernate by jbosstools.

the class ExporterFacadeImpl method setConfiguration.

@Override
public void setConfiguration(IConfiguration configuration) {
    Exporter exporter = (Exporter) getTarget();
    exporter.setMetadataDescriptor(new ConfigurationMetadataDescriptor(configuration));
}
Also used : ConfigurationMetadataDescriptor(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor) Exporter(org.hibernate.tool.hbm2x.Exporter)

Aggregations

ConfigurationMetadataDescriptor (org.jboss.tools.hibernate.runtime.v_5_3.internal.util.ConfigurationMetadataDescriptor)3 Exporter (org.hibernate.tool.hbm2x.Exporter)2 Configuration (org.hibernate.cfg.Configuration)1 AbstractConfigurationFacade (org.jboss.tools.hibernate.runtime.common.AbstractConfigurationFacade)1 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)1 IExporter (org.jboss.tools.hibernate.runtime.spi.IExporter)1 IHibernateMappingExporter (org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter)1 Test (org.junit.Test)1