Search in sources :

Example 16 with DefaultReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class OverrideRepositoryFacadeTest method testGetReverseEngineeringStrategy.

@Test
public void testGetReverseEngineeringStrategy() throws Exception {
    ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy resFacade = FACADE_FACTORY.createReverseEngineeringStrategy(res);
    IReverseEngineeringStrategy result = overrideRepositoryFacade.getReverseEngineeringStrategy(resFacade);
    DelegatingReverseEngineeringStrategy resultTarget = (DelegatingReverseEngineeringStrategy) ((IFacade) result).getTarget();
    Field delegateField = DelegatingReverseEngineeringStrategy.class.getDeclaredField("delegate");
    delegateField.setAccessible(true);
    Assert.assertSame(res, delegateField.get(resultTarget));
}
Also used : Field(java.lang.reflect.Field) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) Test(org.junit.Test)

Example 17 with DefaultReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ServiceImplTest method testNewDatabaseCollector.

@Test
public void testNewDatabaseCollector() {
    IJDBCReader jdbcReader = FACADE_FACTORY.createJDBCReader(JDBCReaderFactory.newJDBCReader(new Configuration().getProperties(), new DefaultReverseEngineeringStrategy(), new StandardServiceRegistryBuilder().build()));
    IDatabaseCollector databaseCollectorFacade = service.newDatabaseCollector(jdbcReader);
    Assert.assertNotNull(databaseCollectorFacade);
    DatabaseCollector databaseCollector = (DatabaseCollector) ((IFacade) databaseCollectorFacade).getTarget();
    Assert.assertNotNull(databaseCollector);
}
Also used : Configuration(org.hibernate.cfg.Configuration) JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) StandardServiceRegistryBuilder(org.hibernate.boot.registry.StandardServiceRegistryBuilder) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) DatabaseCollector(org.hibernate.cfg.reveng.DatabaseCollector) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) Test(org.junit.Test)

Example 18 with DefaultReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class OverrideRepositoryFacadeTest method testGetReverseEngineeringStrategy.

@Test
public void testGetReverseEngineeringStrategy() throws Exception {
    ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy resFacade = FACADE_FACTORY.createReverseEngineeringStrategy(res);
    IReverseEngineeringStrategy result = overrideRepositoryFacade.getReverseEngineeringStrategy(resFacade);
    DelegatingReverseEngineeringStrategy resultTarget = (DelegatingReverseEngineeringStrategy) ((IFacade) result).getTarget();
    Field delegateField = DelegatingReverseEngineeringStrategy.class.getDeclaredField("delegate");
    delegateField.setAccessible(true);
    Assert.assertSame(res, delegateField.get(resultTarget));
}
Also used : Field(java.lang.reflect.Field) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) Test(org.junit.Test)

Example 19 with DefaultReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class OverrideRepositoryFacadeTest method testGetReverseEngineeringStrategy.

@Test
public void testGetReverseEngineeringStrategy() throws Exception {
    ReverseEngineeringStrategy res = new DefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy resFacade = FACADE_FACTORY.createReverseEngineeringStrategy(res);
    IReverseEngineeringStrategy result = overrideRepositoryFacade.getReverseEngineeringStrategy(resFacade);
    DelegatingReverseEngineeringStrategy resultTarget = (DelegatingReverseEngineeringStrategy) ((IFacade) result).getTarget();
    Field delegateField = DelegatingReverseEngineeringStrategy.class.getDeclaredField("delegate");
    delegateField.setAccessible(true);
    Assert.assertSame(res, delegateField.get(resultTarget));
}
Also used : Field(java.lang.reflect.Field) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DelegatingReverseEngineeringStrategy(org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) Test(org.junit.Test)

Example 20 with DefaultReverseEngineeringStrategy

use of org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy in project jbosstools-hibernate by jbosstools.

the class ConfigurationFacadeTest method testSetReverseEngineeringStrategy.

@Test
public void testSetReverseEngineeringStrategy() {
    JDBCMetaDataConfiguration configuration = new JDBCMetaDataConfiguration();
    configurationFacade = FACADE_FACTORY.createConfiguration(configuration);
    ReverseEngineeringStrategy reverseEngineeringStrategy = new DefaultReverseEngineeringStrategy();
    IReverseEngineeringStrategy strategyFacade = FACADE_FACTORY.createReverseEngineeringStrategy(reverseEngineeringStrategy);
    Assert.assertNotSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
    configurationFacade.setReverseEngineeringStrategy(strategyFacade);
    Assert.assertSame(reverseEngineeringStrategy, configuration.getReverseEngineeringStrategy());
}
Also used : JDBCMetaDataConfiguration(org.hibernate.cfg.JDBCMetaDataConfiguration) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ReverseEngineeringStrategy(org.hibernate.cfg.reveng.ReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) Test(org.junit.Test)

Aggregations

DefaultReverseEngineeringStrategy (org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy)36 Test (org.junit.Test)36 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)20 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)20 ReverseEngineeringStrategy (org.hibernate.cfg.reveng.ReverseEngineeringStrategy)16 Configuration (org.hibernate.cfg.Configuration)12 JDBCReader (org.hibernate.cfg.reveng.JDBCReader)12 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)12 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)10 Field (java.lang.reflect.Field)8 DatabaseCollector (org.hibernate.cfg.reveng.DatabaseCollector)8 DelegatingReverseEngineeringStrategy (org.hibernate.cfg.reveng.DelegatingReverseEngineeringStrategy)8 IDatabaseCollector (org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector)8 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)5 AnnotationConfiguration (org.hibernate.cfg.AnnotationConfiguration)2 JdbcMetadataConfiguration (org.jboss.tools.hibernate.runtime.v_5_3.internal.util.JdbcMetadataConfiguration)2 ServiceRegistry (org.hibernate.service.ServiceRegistry)1 ServiceRegistryBuilder (org.hibernate.service.ServiceRegistryBuilder)1