use of org.hibernate.dialect.Dialect in project jbosstools-hibernate by jbosstools.
the class DummyMetadataBuildingContextTest method testInstance.
@Test
public void testInstance() {
assertNotNull(DummyMetadataBuildingContext.INSTANCE);
StandardServiceRegistry serviceRegistry = DummyMetadataBuildingContext.INSTANCE.getBootstrapContext().getServiceRegistry();
JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
Dialect dialect = jdbcServices.getDialect();
assertTrue(dialect instanceof MockDialect);
}
use of org.hibernate.dialect.Dialect in project jbosstools-hibernate by jbosstools.
the class DummyMetadataBuildingContextTest method testInstance.
@Test
public void testInstance() {
assertNotNull(DummyMetadataBuildingContext.INSTANCE);
StandardServiceRegistry serviceRegistry = DummyMetadataBuildingContext.INSTANCE.getBootstrapContext().getServiceRegistry();
JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
Dialect dialect = jdbcServices.getDialect();
assertTrue(dialect instanceof MockDialect);
}
use of org.hibernate.dialect.Dialect in project jbosstools-hibernate by jbosstools.
the class ColumnFacadeImpl method getSqlType.
@Override
public String getSqlType(IConfiguration configuration) {
Column targetColumn = (Column) getTarget();
Configuration configurationTarget = (Configuration) ((IFacade) configuration).getTarget();
Properties properties = configurationTarget.getProperties();
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySettings(properties);
StandardServiceRegistry ssr = ssrb.build();
DialectFactory df = ssr.getService(DialectFactory.class);
Dialect dialectTarget = df.buildDialect(properties, null);
return targetColumn.getSqlType(dialectTarget, MetadataHelper.getMetadata(configurationTarget));
}
use of org.hibernate.dialect.Dialect in project jbosstools-hibernate by jbosstools.
the class ServiceImpl method newDialect.
@Override
public String newDialect(Properties properties, Connection connection) {
DialectFactoryImpl dialectFactory = new DialectFactoryImpl();
dialectFactory.setClassLoaderService(new ClassLoaderServiceImpl());
dialectFactory.setDialectResolver(new StandardDialectResolver());
Dialect dialect = dialectFactory.buildDialect(properties, connection);
return dialect != null ? dialect.toString() : null;
}
use of org.hibernate.dialect.Dialect in project jbosstools-hibernate by jbosstools.
the class ColumnFacadeImpl method getSqlType.
@Override
public String getSqlType(IConfiguration configuration) {
Column targetColumn = (Column) getTarget();
Configuration configurationTarget = (Configuration) ((IFacade) configuration).getTarget();
Properties properties = configurationTarget.getProperties();
StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder();
ssrb.applySettings(properties);
StandardServiceRegistry ssr = ssrb.build();
DialectFactory df = ssr.getService(DialectFactory.class);
Dialect dialectTarget = df.buildDialect(properties, null);
return targetColumn.getSqlType(dialectTarget, MetadataHelper.getMetadata(configurationTarget));
}
Aggregations