Search in sources :

Example 1 with Exporter

use of org.hibernate.tool.hbm2x.Exporter 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 Exporter

use of org.hibernate.tool.hbm2x.Exporter in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateExporter.

@Test
public void testCreateExporter() {
    Exporter exporter = (Exporter) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Exporter.class }, new TestInvocationHandler());
    IExporter facade = facadeFactory.createExporter(exporter);
    Assert.assertSame(exporter, ((IFacade) facade).getTarget());
}
Also used : PersistentClass(org.hibernate.mapping.PersistentClass) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) POJOClass(org.hibernate.tool.hbm2x.pojo.POJOClass) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) QueryExporter(org.hibernate.tool.hbm2x.QueryExporter) HibernateMappingExporter(org.hibernate.tool.hbm2x.HibernateMappingExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) IQueryExporter(org.jboss.tools.hibernate.runtime.spi.IQueryExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) Exporter(org.hibernate.tool.hbm2x.Exporter) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) Test(org.junit.Test)

Example 3 with Exporter

use of org.hibernate.tool.hbm2x.Exporter in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateExporter.

@Test
public void testCreateExporter() {
    Exporter exporter = (Exporter) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Exporter.class }, new TestInvocationHandler());
    IExporter facade = facadeFactory.createExporter(exporter);
    assertSame(exporter, ((IFacade) facade).getTarget());
}
Also used : PersistentClass(org.hibernate.mapping.PersistentClass) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) POJOClass(org.hibernate.tool.hbm2x.pojo.POJOClass) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) QueryExporter(org.hibernate.tool.hbm2x.QueryExporter) HibernateMappingExporter(org.hibernate.tool.hbm2x.HibernateMappingExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) IQueryExporter(org.jboss.tools.hibernate.runtime.spi.IQueryExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) Exporter(org.hibernate.tool.hbm2x.Exporter) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) Test(org.junit.jupiter.api.Test)

Example 4 with Exporter

use of org.hibernate.tool.hbm2x.Exporter in project jbosstools-hibernate by jbosstools.

the class FacadeFactoryTest method testCreateExporter.

@Test
public void testCreateExporter() {
    Exporter exporter = (Exporter) Proxy.newProxyInstance(facadeFactory.getClassLoader(), new Class[] { Exporter.class }, new TestInvocationHandler());
    IExporter facade = facadeFactory.createExporter(exporter);
    assertTrue(facade instanceof ExporterFacadeImpl);
    assertSame(exporter, ((IFacade) facade).getTarget());
}
Also used : PersistentClass(org.hibernate.mapping.PersistentClass) IPOJOClass(org.jboss.tools.hibernate.runtime.spi.IPOJOClass) RootClass(org.hibernate.mapping.RootClass) IPersistentClass(org.jboss.tools.hibernate.runtime.spi.IPersistentClass) POJOClass(org.hibernate.tool.hbm2x.pojo.POJOClass) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) QueryExporter(org.hibernate.tool.hbm2x.QueryExporter) HibernateMappingExporter(org.hibernate.tool.hbm2x.HibernateMappingExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) IQueryExporter(org.jboss.tools.hibernate.runtime.spi.IQueryExporter) Exporter(org.hibernate.tool.hbm2x.Exporter) IHibernateMappingExporter(org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) Test(org.junit.jupiter.api.Test)

Example 5 with Exporter

use of org.hibernate.tool.hbm2x.Exporter in project jbosstools-hibernate by jbosstools.

the class ExporterFacadeImpl method setConfiguration.

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

Aggregations

Exporter (org.hibernate.tool.hbm2x.Exporter)20 IExporter (org.jboss.tools.hibernate.runtime.spi.IExporter)16 GenericExporter (org.hibernate.tool.hbm2x.GenericExporter)15 Hbm2DDLExporter (org.hibernate.tool.hbm2x.Hbm2DDLExporter)15 QueryExporter (org.hibernate.tool.hbm2x.QueryExporter)15 IGenericExporter (org.jboss.tools.hibernate.runtime.spi.IGenericExporter)15 IHbm2DDLExporter (org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter)15 IQueryExporter (org.jboss.tools.hibernate.runtime.spi.IQueryExporter)15 IHibernateMappingExporter (org.jboss.tools.hibernate.runtime.spi.IHibernateMappingExporter)12 PersistentClass (org.hibernate.mapping.PersistentClass)11 RootClass (org.hibernate.mapping.RootClass)11 HibernateMappingExporter (org.hibernate.tool.hbm2x.HibernateMappingExporter)11 POJOClass (org.hibernate.tool.hbm2x.pojo.POJOClass)11 IPOJOClass (org.jboss.tools.hibernate.runtime.spi.IPOJOClass)11 IPersistentClass (org.jboss.tools.hibernate.runtime.spi.IPersistentClass)11 Test (org.junit.jupiter.api.Test)10 Test (org.junit.Test)5 HibernateConfigurationExporter (org.hibernate.tool.hbm2x.HibernateConfigurationExporter)4 File (java.io.File)2 FileWriter (java.io.FileWriter)2