Search in sources :

Example 1 with DialectFactory

use of org.hibernate.service.jdbc.dialect.spi.DialectFactory 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();
    ServiceRegistryBuilder ssrb = new ServiceRegistryBuilder();
    ssrb.applySettings(properties);
    ServiceRegistry ssr = ssrb.buildServiceRegistry();
    DialectFactory df = ssr.getService(DialectFactory.class);
    Dialect dialectTarget = df.buildDialect(properties, null);
    return targetColumn.getSqlType(dialectTarget, configurationTarget.buildMapping());
}
Also used : IConfiguration(org.jboss.tools.hibernate.runtime.spi.IConfiguration) Configuration(org.hibernate.cfg.Configuration) Column(org.hibernate.mapping.Column) Dialect(org.hibernate.dialect.Dialect) DialectFactory(org.hibernate.service.jdbc.dialect.spi.DialectFactory) ServiceRegistry(org.hibernate.service.ServiceRegistry) Properties(java.util.Properties) ServiceRegistryBuilder(org.hibernate.service.ServiceRegistryBuilder)

Aggregations

Properties (java.util.Properties)1 Configuration (org.hibernate.cfg.Configuration)1 Dialect (org.hibernate.dialect.Dialect)1 Column (org.hibernate.mapping.Column)1 ServiceRegistry (org.hibernate.service.ServiceRegistry)1 ServiceRegistryBuilder (org.hibernate.service.ServiceRegistryBuilder)1 DialectFactory (org.hibernate.service.jdbc.dialect.spi.DialectFactory)1 IConfiguration (org.jboss.tools.hibernate.runtime.spi.IConfiguration)1