Search in sources :

Example 11 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) 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 12 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 13 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_4.internal.util.ConfigurationMetadataDescriptor) Exporter(org.hibernate.tool.hbm2x.Exporter)

Example 14 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_5.internal.util.ConfigurationMetadataDescriptor) Exporter(org.hibernate.tool.hbm2x.Exporter)

Example 15 with Exporter

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

the class ExporterFacadeTest method testSetCustomProperties.

@Test
public void testSetCustomProperties() {
    Exporter exporter = new GenericExporter();
    exporterFacade = FACADE_FACTORY.createExporter(exporter);
    Properties properties = new Properties();
    exporterFacade.setCustomProperties(properties);
    exporter = new HibernateConfigurationExporter();
    exporterFacade = FACADE_FACTORY.createExporter(exporter);
    exporterFacade.setCustomProperties(properties);
    Assert.assertSame(properties, ((HibernateConfigurationExporter) exporter).getCustomProperties());
}
Also used : GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) HibernateConfigurationExporter(org.hibernate.tool.hbm2x.HibernateConfigurationExporter) GenericExporter(org.hibernate.tool.hbm2x.GenericExporter) Exporter(org.hibernate.tool.hbm2x.Exporter) QueryExporter(org.hibernate.tool.hbm2x.QueryExporter) HibernateConfigurationExporter(org.hibernate.tool.hbm2x.HibernateConfigurationExporter) Hbm2DDLExporter(org.hibernate.tool.hbm2x.Hbm2DDLExporter) IQueryExporter(org.jboss.tools.hibernate.runtime.spi.IQueryExporter) IHbm2DDLExporter(org.jboss.tools.hibernate.runtime.spi.IHbm2DDLExporter) IExporter(org.jboss.tools.hibernate.runtime.spi.IExporter) IGenericExporter(org.jboss.tools.hibernate.runtime.spi.IGenericExporter) Properties(java.util.Properties) Test(org.junit.Test)

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