Package org.hibernate.service.config.spi

Examples of org.hibernate.service.config.spi.ConfigurationService$Converter


           ConverterHome home =
               (ConverterHome)PortableRemoteObject.narrow(objref,
                                            ConverterHome.class);

           Converter currencyConverter = home.create();
           double amount = currencyConverter.dollarToYen(100.00);
           System.out.println(String.valueOf(amount));
           amount = currencyConverter.yenToEuro(100.00);
           System.out.println(String.valueOf(amount));

           System.exit(0);

       } catch (Exception ex) {
View Full Code Here


        private boolean globallyQuotedIdentifiers;
    private String defaultSchemaName;
    private String defaultCatalogName;

    public OptionsImpl(ServiceRegistry serviceRegistry) {
      ConfigurationService configService = serviceRegistry.getService( ConfigurationService.class );

      // cache access type
      defaultCacheAccessType = configService.getSetting(
          AvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY,
          new ConfigurationService.Converter<AccessType>() {
            @Override
            public AccessType convert(Object value) {
              return AccessType.fromExternalName( value.toString() );
            }
          }
      );

      useNewIdentifierGenerators = configService.getSetting(
          AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS,
          new ConfigurationService.Converter<Boolean>() {
            @Override
            public Boolean convert(Object value) {
              return Boolean.parseBoolean( value.toString() );
            }
          },
          false
      );

      defaultSchemaName = configService.getSetting(
          AvailableSettings.DEFAULT_SCHEMA,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
            }
          },
          null
      );

      defaultCatalogName = configService.getSetting(
          AvailableSettings.DEFAULT_CATALOG,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
            }
          },
          null
      );

            globallyQuotedIdentifiers = configService.getSetting(
                    AvailableSettings.GLOBALLY_QUOTED_IDENTIFIERS,
                    new ConfigurationService.Converter<Boolean>() {
                        @Override
                        public Boolean convert(Object value) {
                            return Boolean.parseBoolean( value.toString() );
View Full Code Here

  @Override
  public StatisticsImplementor initiateService(
      SessionFactoryImplementor sessionFactory,
      MetadataImplementor metadata,
      ServiceRegistryImplementor registry) {
    ConfigurationService configurationService =  registry.getService( ConfigurationService.class );
    final Object configValue = configurationService.getSetting( STATS_BUILDER, null );
    return initiateServiceInternal( sessionFactory, configValue, registry );
  }
View Full Code Here

  }

  private static Class<? extends EntityCopyObserver> determineEntityCopyObserverClass(
      SessionFactoryImplementor sessionFactory) {
    final ServiceRegistry serviceRegistry = sessionFactory.getServiceRegistry();
    final ConfigurationService configurationService
        = serviceRegistry.getService( ConfigurationService.class );
    final String entityCopyObserverStrategyString = configurationService.getSetting(
        ENTITY_COPY_OBSERVER_STRATEGY_PROPERTY_NAME,
        new ConfigurationService.Converter<String>() {
          @Override
          public String convert(Object value) {
            return value.toString();
View Full Code Here

  @Override
  public StatisticsImplementor initiateService(
      SessionFactoryImplementor sessionFactory,
      MetadataImplementor metadata,
      ServiceRegistryImplementor registry) {
    ConfigurationService configurationService =  registry.getService( ConfigurationService.class );
    final Object configValue = configurationService.getSetting( STATS_BUILDER, null );
    return initiateServiceInternal( sessionFactory, configValue, registry );
  }
View Full Code Here

        private boolean globallyQuotedIdentifiers;
    private String defaultSchemaName;
    private String defaultCatalogName;

    public OptionsImpl(BasicServiceRegistry serviceRegistry) {
      ConfigurationService configService = serviceRegistry.getService( ConfigurationService.class );

      // cache access type
      defaultCacheAccessType = configService.getSetting(
          AvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY,
          new ConfigurationService.Converter<AccessType>() {
            @Override
            public AccessType convert(Object value) {
              return AccessType.fromExternalName( value.toString() );
            }
          }
      );

      useNewIdentifierGenerators = configService.getSetting(
          AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS,
          new ConfigurationService.Converter<Boolean>() {
            @Override
            public Boolean convert(Object value) {
              return Boolean.parseBoolean( value.toString() );
            }
          },
          false
      );

      defaultSchemaName = configService.getSetting(
          AvailableSettings.DEFAULT_SCHEMA,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
            }
          },
          null
      );

      defaultCatalogName = configService.getSetting(
          AvailableSettings.DEFAULT_CATALOG,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
            }
          },
          null
      );

            globallyQuotedIdentifiers = configService.getSetting(
                    AvailableSettings.GLOBALLY_QUOTED_IDENTIFIERS,
                    new ConfigurationService.Converter<Boolean>() {
                        @Override
                        public Boolean convert(Object value) {
                            return Boolean.parseBoolean( value.toString() );
View Full Code Here

        private boolean useNewIdentifierGenerators;
    private String defaultSchemaName;
    private String defaultCatalogName;

    public OptionsImpl(BasicServiceRegistry serviceRegistry) {
      ConfigurationService configService = serviceRegistry.getService( ConfigurationService.class );

      // cache access type
      defaultCacheAccessType = configService.getSetting(
          AvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY,
          new ConfigurationService.Converter<AccessType>() {
            @Override
            public AccessType convert(Object value) {
              return AccessType.fromExternalName( value.toString() );
            }
          }
      );

      useNewIdentifierGenerators = configService.getSetting(
          AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS,
          new ConfigurationService.Converter<Boolean>() {
            @Override
            public Boolean convert(Object value) {
              return Boolean.parseBoolean( value.toString() );
            }
          },
          false
      );

      defaultSchemaName = configService.getSetting(
          AvailableSettings.DEFAULT_SCHEMA,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
            }
          },
          null
      );

      defaultCatalogName = configService.getSetting(
          AvailableSettings.DEFAULT_CATALOG,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
View Full Code Here

        private boolean globallyQuotedIdentifiers;
    private String defaultSchemaName;
    private String defaultCatalogName;

    public OptionsImpl(BasicServiceRegistry serviceRegistry) {
      ConfigurationService configService = serviceRegistry.getService( ConfigurationService.class );

      // cache access type
      defaultCacheAccessType = configService.getSetting(
          AvailableSettings.DEFAULT_CACHE_CONCURRENCY_STRATEGY,
          new ConfigurationService.Converter<AccessType>() {
            @Override
            public AccessType convert(Object value) {
              return AccessType.fromExternalName( value.toString() );
            }
          }
      );

      useNewIdentifierGenerators = configService.getSetting(
          AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS,
          new ConfigurationService.Converter<Boolean>() {
            @Override
            public Boolean convert(Object value) {
              return Boolean.parseBoolean( value.toString() );
            }
          },
          false
      );

      defaultSchemaName = configService.getSetting(
          AvailableSettings.DEFAULT_SCHEMA,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
            }
          },
          null
      );

      defaultCatalogName = configService.getSetting(
          AvailableSettings.DEFAULT_CATALOG,
          new ConfigurationService.Converter<String>() {
            @Override
            public String convert(Object value) {
              return value.toString();
            }
          },
          null
      );

            globallyQuotedIdentifiers = configService.getSetting(
                    AvailableSettings.GLOBALLY_QUOTED_IDENTIFIERS,
                    new ConfigurationService.Converter<Boolean>() {
                        @Override
                        public Boolean convert(Object value) {
                            return Boolean.parseBoolean( value.toString() );
View Full Code Here

TOP

Related Classes of org.hibernate.service.config.spi.ConfigurationService$Converter

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.