use of org.hibernate.boot.registry.StandardServiceRegistry in project hibernate-orm by hibernate.
the class SchemaUpdate method main.
public static void main(String[] args) {
try {
final CommandLineArgs parsedArgs = CommandLineArgs.parseCommandLineArgs(args);
final StandardServiceRegistry serviceRegistry = buildStandardServiceRegistry(parsedArgs);
try {
final MetadataImplementor metadata = buildMetadata(parsedArgs, serviceRegistry);
new SchemaUpdate().setOutputFile(parsedArgs.outputFile).setDelimiter(parsedArgs.delimiter).execute(parsedArgs.targetTypes, metadata, serviceRegistry);
} finally {
StandardServiceRegistryBuilder.destroy(serviceRegistry);
}
} catch (Exception e) {
LOG.unableToRunSchemaUpdate(e);
e.printStackTrace();
}
}
use of org.hibernate.boot.registry.StandardServiceRegistry in project hibernate-orm by hibernate.
the class SchemaValidator method main.
public static void main(String[] args) {
try {
final CommandLineArgs parsedArgs = CommandLineArgs.parseCommandLineArgs(args);
final StandardServiceRegistry serviceRegistry = buildStandardServiceRegistry(parsedArgs);
try {
final MetadataImplementor metadata = buildMetadata(parsedArgs, serviceRegistry);
new SchemaValidator().validate(metadata, serviceRegistry);
} finally {
StandardServiceRegistryBuilder.destroy(serviceRegistry);
}
} catch (Exception e) {
LOG.unableToRunSchemaUpdate(e);
e.printStackTrace();
}
}
use of org.hibernate.boot.registry.StandardServiceRegistry 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, configurationTarget.buildMapping());
}
use of org.hibernate.boot.registry.StandardServiceRegistry 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.boot.registry.StandardServiceRegistry 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