Package org.hibernate.service

Examples of org.hibernate.service.ServiceRegistry


   * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
   */
  public SessionFactory buildSessionFactory() throws HibernateException {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    final ServiceRegistry serviceRegistry =  new ServiceRegistryBuilder()
        .applySettings( properties )
        .buildServiceRegistry();
    setSessionFactoryObserver(
        new SessionFactoryObserver() {
          @Override
View Full Code Here


   * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
   */
  public SessionFactory buildSessionFactory() throws HibernateException {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    final ServiceRegistry serviceRegistry =  new ServiceRegistryBuilder()
        .applySettings( properties )
        .buildServiceRegistry();
    setSessionFactoryObserver(
        new SessionFactoryObserver() {
          @Override
View Full Code Here

    this.dropSQL = configuration.generateDropSchemaScript( dialect );
    this.createSQL = configuration.generateSchemaCreationScript( dialect );
  }

  public SchemaExport(MetadataImplementor metadata) {
    ServiceRegistry serviceRegistry = metadata.getServiceRegistry();
    this.connectionHelper = new SuppliedConnectionProviderConnectionHelper(
        serviceRegistry.getService( ConnectionProvider.class )
    );
        JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class );
    this.sqlStatementLogger = jdbcServices.getSqlStatementLogger();
    this.formatter = ( sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE ).getFormatter();
    this.sqlExceptionHelper = jdbcServices.getSqlExceptionHelper();

    this.importFiles = ConfigurationHelper.getString(
        AvailableSettings.HBM2DDL_IMPORT_FILES,
        serviceRegistry.getService( ConfigurationService.class ).getSettings(),
        DEFAULT_IMPORT_FILE
    );

    final Dialect dialect = jdbcServices.getDialect();
    this.dropSQL = metadata.getDatabase().generateDropSchemaScript( dialect );
View Full Code Here

  protected void doStart() {
    final Configuration configuration = getConfiguration();
    ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
    builder.applySettings( configuration.getProperties() );
    ServiceRegistry serviceRegistry = builder.buildServiceRegistry();
    integrateEnvers( configuration, serviceRegistry );

    if (schemaUpdate) {
      SchemaUpdate update = new SchemaUpdate(serviceRegistry, configuration);
     
View Full Code Here

 
  public void analyze(Configuration cfg) {
   
    ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
    builder.applySettings(cfg.getProperties());
    ServiceRegistry serviceRegistry = builder.buildServiceRegistry();
    Settings settings = cfg.buildSettings(serviceRegistry);
   
    for (int i = 0; i < detectors.length; i++) {
      detectors[i].initialize( cfg, settings );
      detectors[i].visit(cfg, this);
View Full Code Here

  public void initialize(Configuration cfg, Settings settings) {
    super.initialize( cfg, settings );
    ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
    builder.applySettings(cfg.getProperties());
    ServiceRegistry serviceRegistry = builder.buildServiceRegistry();
   
    dialect = serviceRegistry.getService(JdbcServices.class).getDialect();

    tableSelector = new TableSelectorStrategy(
        new DefaultReverseEngineeringStrategy() );
    reader = JDBCReaderFactory.newJDBCReader( cfg.getProperties(),
        settings, tableSelector, serviceRegistry);
View Full Code Here

        this.cfg = cfg;

    ServiceRegistryBuilder builder = new ServiceRegistryBuilder();
    builder.applySettings(cfg.getProperties());
    ServiceRegistry serviceRegistry = builder.buildServiceRegistry();
    JdbcServices jdbcServices = serviceRegistry.getService(JdbcServices.class);
    Settings settings = cfg.buildSettings(serviceRegistry);
   
        dialect = jdbcServices.getDialect(); // TODO: get it from somewhere "cached".

        String defaultCatalog = settings.getDefaultCatalogName();
View Full Code Here

   * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
   */
  public SessionFactory buildSessionFactory() throws HibernateException {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    final ServiceRegistry serviceRegistry =  new StandardServiceRegistryBuilder()
        .applySettings( properties )
        .build();
    setSessionFactoryObserver(
        new SessionFactoryObserver() {
          @Override
View Full Code Here

    this.dropSQL = configuration.generateDropSchemaScript( dialect );
    this.createSQL = configuration.generateSchemaCreationScript( dialect );
  }

  public SchemaExport(MetadataImplementor metadata) {
    ServiceRegistry serviceRegistry = metadata.getServiceRegistry();
    this.connectionHelper = new SuppliedConnectionProviderConnectionHelper(
        serviceRegistry.getService( ConnectionProvider.class )
    );
        JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class );
    this.sqlStatementLogger = jdbcServices.getSqlStatementLogger();
    this.formatter = ( sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE ).getFormatter();
    this.sqlExceptionHelper = jdbcServices.getSqlExceptionHelper();

    this.importFiles = ConfigurationHelper.getString(
        AvailableSettings.HBM2DDL_IMPORT_FILES,
        serviceRegistry.getService( ConfigurationService.class ).getSettings(),
        DEFAULT_IMPORT_FILE
    );

    final Dialect dialect = jdbcServices.getDialect();
    this.dropSQL = metadata.getDatabase().generateDropSchemaScript( dialect );
View Full Code Here

   * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
   */
  public SessionFactory buildSessionFactory() throws HibernateException {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    final ServiceRegistry serviceRegistry =  new ServiceRegistryBuilder()
        .applySettings( properties )
        .buildServiceRegistry();
    setSessionFactoryObserver(
        new SessionFactoryObserver() {
          @Override
View Full Code Here

TOP

Related Classes of org.hibernate.service.ServiceRegistry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.