org.hibernate.cfg.Environment.verifyProperties()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(9.7k)|赞(0)|评价(0)|浏览(103)

本文整理了Java中org.hibernate.cfg.Environment.verifyProperties()方法的一些代码示例,展示了Environment.verifyProperties()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Environment.verifyProperties()方法的具体详情如下:
包路径:org.hibernate.cfg.Environment
类名称:Environment
方法名:verifyProperties

Environment.verifyProperties介绍

[英]No longer effective.
[中]不再有效。

代码示例

代码示例来源:origin: hibernate/hibernate

private void addProperties(Element parent) {
  Iterator iter = parent.elementIterator( "property" );
  while ( iter.hasNext() ) {
    Element node = ( Element ) iter.next();
    String name = node.attributeValue( "name" );
    String value = node.getText().trim();
    log.debug( name + "=" + value );
    properties.setProperty( name, value );
    if ( !name.startsWith( "hibernate" ) ) properties.setProperty( "hibernate." + name, value );
  }
  Environment.verifyProperties( properties );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private void addProperties(Element parent) {
  Iterator itr = parent.elementIterator( "property" );
  while ( itr.hasNext() ) {
    Element node = (Element) itr.next();
    String name = node.attributeValue( "name" );
    String value = node.getText().trim();
    LOG.debugf( "%s=%s", name, value );
    properties.setProperty( name, value );
    if ( !name.startsWith( "hibernate" ) ) {
      properties.setProperty( "hibernate." + name, value );
    }
  }
  Environment.verifyProperties( properties );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private void addProperties(Element parent) {
  Iterator itr = parent.elementIterator( "property" );
  while ( itr.hasNext() ) {
    Element node = (Element) itr.next();
    String name = node.attributeValue( "name" );
    String value = node.getText().trim();
    LOG.debugf( "%s=%s", name, value );
    properties.setProperty( name, value );
    if ( !name.startsWith( "hibernate" ) ) {
      properties.setProperty( "hibernate." + name, value );
    }
  }
  Environment.verifyProperties( properties );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

/**
 * Build the service registry accounting for all settings and service initiators and services.
 *
 * @return The built service registry
 */
public ServiceRegistry buildServiceRegistry() {
  Map<?,?> settingsCopy = new HashMap();
  settingsCopy.putAll( settings );
  Environment.verifyProperties( settingsCopy );
  ConfigurationHelper.resolvePlaceHolders( settingsCopy );
  for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class ).getIntegrators() ) {
    if ( ServiceContributingIntegrator.class.isInstance( integrator ) ) {
      ServiceContributingIntegrator.class.cast( integrator ).prepareServices( this );
    }
  }
  return new StandardServiceRegistryImpl( bootstrapServiceRegistry, initiators, providedServices, settingsCopy );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Build the service registry accounting for all settings and service initiators and services.
 *
 * @return The built service registry
 */
public ServiceRegistry buildServiceRegistry() {
  Map<?,?> settingsCopy = new HashMap();
  settingsCopy.putAll( settings );
  Environment.verifyProperties( settingsCopy );
  ConfigurationHelper.resolvePlaceHolders( settingsCopy );
  for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class ).getIntegrators() ) {
    if ( ServiceContributingIntegrator.class.isInstance( integrator ) ) {
      ServiceContributingIntegrator.class.cast( integrator ).prepareServices( this );
    }
  }
  return new StandardServiceRegistryImpl( bootstrapServiceRegistry, initiators, providedServices, settingsCopy );
}

代码示例来源:origin: hibernate/hibernate

/**
 * Instantiate a new <tt>SessionFactory</tt>, using the properties and
 * mappings in this configuration. The <tt>SessionFactory</tt> will be
 * immutable, so changes made to the <tt>Configuration</tt> after
 * building the <tt>SessionFactory</tt> will not affect it.
 *
 * @return a new factory for <tt>Session</tt>s
 * @see org.hibernate.SessionFactory
 */
public SessionFactory buildSessionFactory() throws HibernateException {
  log.debug( "Preparing to build session factory with filters : " + filterDefinitions );
  secondPassCompile();
  validate();
  Environment.verifyProperties( properties );
  Properties copy = new Properties();
  copy.putAll( properties );
  Settings settings = buildSettings();
  return new SessionFactoryImpl( this, mapping, settings, sessionEventListenerConfig.shallowCopy() );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: sismics/reader

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties(properties);
  ConfigurationHelper.resolvePlaceHolders(properties);
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings(properties).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
  Environment.verifyProperties( properties );
  ConfigurationHelper.resolvePlaceHolders( properties );
  return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

Environment.verifyProperties( properties );
Properties copy = new Properties();
copy.putAll( properties );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

Environment.verifyProperties( properties );
Properties copy = new Properties();
copy.putAll( properties );

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate.core

/**
 * Create a {@link SessionFactory} using the properties and mappings in this configuration. The
 * {@link SessionFactory} will be immutable, so changes made to {@code this} {@link Configuration} after
 * building the {@link SessionFactory} will not affect it.
 *
 * @return The build {@link SessionFactory}
 *
 * @throws HibernateException usually indicates an invalid configuration or invalid mapping information
 *
 * @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
        public void sessionFactoryCreated(SessionFactory factory) {
        }
        @Override
        public void sessionFactoryClosed(SessionFactory factory) {
          ( (StandardServiceRegistryImpl) serviceRegistry ).destroy();
        }
      }
  );
  return buildSessionFactory( serviceRegistry );
}

代码示例来源:origin: org.hibernate/com.springsource.org.hibernate

/**
 * Create a {@link SessionFactory} using the properties and mappings in this configuration. The
 * {@link SessionFactory} will be immutable, so changes made to {@code this} {@link Configuration} after
 * building the {@link SessionFactory} will not affect it.
 *
 * @return The build {@link SessionFactory}
 *
 * @throws HibernateException usually indicates an invalid configuration or invalid mapping information
 *
 * @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
        public void sessionFactoryCreated(SessionFactory factory) {
        }
        @Override
        public void sessionFactoryClosed(SessionFactory factory) {
          ( (StandardServiceRegistryImpl) serviceRegistry ).destroy();
        }
      }
  );
  return buildSessionFactory( serviceRegistry );
}

相关文章