Search in sources :

Example 6 with IJDBCReader

use of org.jboss.tools.hibernate.runtime.spi.IJDBCReader in project jbosstools-hibernate by jbosstools.

the class ServiceImpl method newDatabaseCollector.

@Override
public IDatabaseCollector newDatabaseCollector(IJDBCReader jdbcReader) {
    assert jdbcReader instanceof IFacade;
    JDBCReader jdbcReaderTarget = (JDBCReader) ((IFacade) jdbcReader).getTarget();
    MetaDataDialect metadataDialect = jdbcReaderTarget.getMetaDataDialect();
    return facadeFactory.createDatabaseCollector(new DefaultDatabaseCollector(metadataDialect));
}
Also used : MetaDataDialect(org.hibernate.cfg.reveng.dialect.MetaDataDialect) DefaultDatabaseCollector(org.hibernate.cfg.reveng.DefaultDatabaseCollector) IFacade(org.jboss.tools.hibernate.runtime.common.IFacade) IJDBCReader(org.jboss.tools.hibernate.runtime.spi.IJDBCReader) JDBCReader(org.hibernate.cfg.reveng.JDBCReader)

Example 7 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 8 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 : AnnotationConfiguration(org.hibernate.cfg.AnnotationConfiguration) 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 9 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 : 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 10 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)

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