Search in sources :

Example 31 with IJDBCReader

use of org.jboss.tools.hibernate.runtime.spi.IJDBCReader 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 32 with IJDBCReader

use of org.jboss.tools.hibernate.runtime.spi.IJDBCReader 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 33 with IJDBCReader

use of org.jboss.tools.hibernate.runtime.spi.IJDBCReader 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 : JdbcMetadataConfiguration(org.jboss.tools.hibernate.runtime.v_5_3.internal.util.JdbcMetadataConfiguration) Configuration(org.hibernate.cfg.Configuration) 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)

Aggregations

IJDBCReader (org.jboss.tools.hibernate.runtime.spi.IJDBCReader)33 JDBCReader (org.hibernate.cfg.reveng.JDBCReader)24 Test (org.junit.Test)24 DefaultReverseEngineeringStrategy (org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy)20 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)17 Configuration (org.hibernate.cfg.Configuration)12 IFacade (org.jboss.tools.hibernate.runtime.common.IFacade)12 IDatabaseCollector (org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector)9 DatabaseCollector (org.hibernate.cfg.reveng.DatabaseCollector)8 DefaultDatabaseCollector (org.hibernate.cfg.reveng.DefaultDatabaseCollector)8 MetaDataDialect (org.hibernate.cfg.reveng.dialect.MetaDataDialect)8 IReverseEngineeringStrategy (org.jboss.tools.hibernate.runtime.spi.IReverseEngineeringStrategy)8 StandardServiceRegistryBuilder (org.hibernate.boot.registry.StandardServiceRegistryBuilder)5 JDBCMetaDataConfiguration (org.hibernate.cfg.JDBCMetaDataConfiguration)3 AnnotationConfiguration (org.hibernate.cfg.AnnotationConfiguration)2 ServiceRegistry (org.hibernate.service.ServiceRegistry)1 ServiceRegistryBuilder (org.hibernate.service.ServiceRegistryBuilder)1 HibernateException (org.jboss.tools.hibernate.runtime.spi.HibernateException)1 IProgressListener (org.jboss.tools.hibernate.runtime.spi.IProgressListener)1 IService (org.jboss.tools.hibernate.runtime.spi.IService)1