Search in sources :

Example 21 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 = 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 : AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) 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 22 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() {
    Configuration cfg = new Configuration();
    IJDBCReader jdbcReader = FACADE_FACTORY.createJDBCReader(JDBCReaderFactory.newJDBCReader(cfg.getProperties(), cfg.buildSettings(), new DefaultReverseEngineeringStrategy()));
    IDatabaseCollector databaseCollectorFacade = service.newDatabaseCollector(jdbcReader);
    Assert.assertNotNull(databaseCollectorFacade);
    DatabaseCollector databaseCollector = (DatabaseCollector) ((IFacade) databaseCollectorFacade).getTarget();
    Assert.assertNotNull(databaseCollector);
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) 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 23 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 24 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 : 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 25 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() {
    Configuration cfg = new Configuration();
    ServiceRegistry sr = new ServiceRegistryBuilder().buildServiceRegistry();
    IJDBCReader jdbcReader = FACADE_FACTORY.createJDBCReader(JDBCReaderFactory.newJDBCReader(cfg.getProperties(), cfg.buildSettings(sr), new DefaultReverseEngineeringStrategy(), sr));
    IDatabaseCollector databaseCollectorFacade = service.newDatabaseCollector(jdbcReader);
    Assert.assertNotNull(databaseCollectorFacade);
    DatabaseCollector databaseCollector = (DatabaseCollector) ((IFacade) databaseCollectorFacade).getTarget();
    Assert.assertNotNull(databaseCollector);
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) DefaultReverseEngineeringStrategy(org.hibernate.cfg.reveng.DefaultReverseEngineeringStrategy) ServiceRegistry(org.hibernate.service.ServiceRegistry) IDatabaseCollector(org.jboss.tools.hibernate.runtime.spi.IDatabaseCollector) ServiceRegistryBuilder(org.hibernate.service.ServiceRegistryBuilder) 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