Search in sources :

Example 11 with JDBCReader

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

the class ServiceImplTest method testNewJDBCReader.

@Test
public void testNewJDBCReader() {
    IConfiguration configuration = FACADE_FACTORY.createConfiguration(new Configuration());
    IReverseEngineeringStrategy engineeringStrategy = FACADE_FACTORY.createReverseEngineeringStrategy(new DefaultReverseEngineeringStrategy());
    IJDBCReader jdbcReaderFacade = service.newJDBCReader(configuration, engineeringStrategy);
    Assert.assertNotNull(jdbcReaderFacade);
    JDBCReader reader = (JDBCReader) ((IFacade) jdbcReaderFacade).getTarget();
    Assert.assertNotNull(reader);
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) Test(org.junit.Test)

Example 12 with JDBCReader

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

the class ServiceImplTest method testNewJDBCReader.

@Test
public void testNewJDBCReader() {
    IConfiguration configuration = service.newDefaultConfiguration();
    configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    IReverseEngineeringStrategy strategy = service.newDefaultReverseEngineeringStrategy();
    IJDBCReader jdbcReader = service.newJDBCReader(configuration, strategy);
    Assert.assertNotNull(jdbcReader);
    Object target = ((IFacade) jdbcReader).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof JDBCReader);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) Test(org.junit.Test)

Example 13 with JDBCReader

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

the class FacadeFactoryTest method testCreateJDBCReader.

@Test
public void testCreateJDBCReader() {
    JDBCReader jdbcReader = new JDBCReader(null, null, null, null, null, new DefaultReverseEngineeringStrategy());
    IJDBCReader facade = facadeFactory.createJDBCReader(jdbcReader);
    Assert.assertSame(jdbcReader, ((IFacade) facade).getTarget());
}
Also used : DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) Test(org.junit.Test)

Example 14 with JDBCReader

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

the class ServiceImplTest method testNewJDBCReader.

@Test
public void testNewJDBCReader() {
    IConfiguration configuration = service.newDefaultConfiguration();
    configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    IReverseEngineeringStrategy strategy = service.newDefaultReverseEngineeringStrategy();
    IJDBCReader jdbcReader = service.newJDBCReader(configuration, strategy);
    Assert.assertNotNull(jdbcReader);
    Object target = ((IFacade) jdbcReader).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof JDBCReader);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) Test(org.junit.Test)

Example 15 with JDBCReader

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

the class ServiceImplTest method testNewJDBCReader.

@Test
public void testNewJDBCReader() {
    IConfiguration configuration = service.newDefaultConfiguration();
    configuration.setProperty("hibernate.dialect", "org.hibernate.dialect.H2Dialect");
    IReverseEngineeringStrategy strategy = service.newDefaultReverseEngineeringStrategy();
    IJDBCReader jdbcReader = service.newJDBCReader(configuration, strategy);
    Assert.assertNotNull(jdbcReader);
    Object target = ((IFacade) jdbcReader).getTarget();
    Assert.assertNotNull(target);
    Assert.assertTrue(target instanceof JDBCReader);
}
Also used : IReverseEngineeringStrategy(org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy) IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader) Test(org.junit.Test)

Aggregations

JDBCReader (org.hibernate.cfg.reveng.JDBCReader)24 IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)24 Test (org.junit.Test)16 DefaultReverseEngineeringStrategy (org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy)12 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)12 DefaultDatabaseCollector (org.hibernate.cfg.reveng.DefaultDatabaseCollector)8 MetaDataDialect (org.hibernate.cfg.reveng.dialect.MetaDataDialect)8 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)8 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)8 Configuration (org.hibernate.cfg.Configuration)4 AnnotationConfiguration (org.hibernate.cfg.AnnotationConfiguration)1