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);
}
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);
}
use of org.jboss.tools.hibernate.runtime.spi.IJDBCReader in project jbosstools-hibernate by jbosstools.
the class LazyDatabaseSchemaWorkbenchAdapter method readDatabaseSchema.
protected IDatabaseCollector readDatabaseSchema(final IProgressMonitor monitor, final ConsoleConfiguration consoleConfiguration, final IReverseEngineeringStrategy strategy) {
final IConfiguration configuration = consoleConfiguration.buildWith(null, false);
return (IDatabaseCollector) consoleConfiguration.execute(new ExecutionContext.Command() {
public Object execute() {
IDatabaseCollector db = null;
try {
IService service = consoleConfiguration.getHibernateExtension().getHibernateService();
IJDBCReader reader = service.newJDBCReader(configuration, strategy);
db = service.newDatabaseCollector(reader);
reader.readDatabaseSchema(db, new ProgressListener(monitor));
} catch (UnsupportedOperationException he) {
throw new HibernateException(he);
} catch (Exception he) {
he.printStackTrace();
throw new HibernateException(he.getMessage(), he.getCause());
}
return db;
}
});
}
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));
}
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));
}
Aggregations