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

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

本文整理了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

  1. private void addProperties(Element parent) {
  2. Iterator iter = parent.elementIterator( "property" );
  3. while ( iter.hasNext() ) {
  4. Element node = ( Element ) iter.next();
  5. String name = node.attributeValue( "name" );
  6. String value = node.getText().trim();
  7. log.debug( name + "=" + value );
  8. properties.setProperty( name, value );
  9. if ( !name.startsWith( "hibernate" ) ) properties.setProperty( "hibernate." + name, value );
  10. }
  11. Environment.verifyProperties( properties );
  12. }

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

  1. private void addProperties(Element parent) {
  2. Iterator itr = parent.elementIterator( "property" );
  3. while ( itr.hasNext() ) {
  4. Element node = (Element) itr.next();
  5. String name = node.attributeValue( "name" );
  6. String value = node.getText().trim();
  7. LOG.debugf( "%s=%s", name, value );
  8. properties.setProperty( name, value );
  9. if ( !name.startsWith( "hibernate" ) ) {
  10. properties.setProperty( "hibernate." + name, value );
  11. }
  12. }
  13. Environment.verifyProperties( properties );
  14. }

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

  1. private void addProperties(Element parent) {
  2. Iterator itr = parent.elementIterator( "property" );
  3. while ( itr.hasNext() ) {
  4. Element node = (Element) itr.next();
  5. String name = node.attributeValue( "name" );
  6. String value = node.getText().trim();
  7. LOG.debugf( "%s=%s", name, value );
  8. properties.setProperty( name, value );
  9. if ( !name.startsWith( "hibernate" ) ) {
  10. properties.setProperty( "hibernate." + name, value );
  11. }
  12. }
  13. Environment.verifyProperties( properties );
  14. }

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

  1. /**
  2. * Build the service registry accounting for all settings and service initiators and services.
  3. *
  4. * @return The built service registry
  5. */
  6. public ServiceRegistry buildServiceRegistry() {
  7. Map<?,?> settingsCopy = new HashMap();
  8. settingsCopy.putAll( settings );
  9. Environment.verifyProperties( settingsCopy );
  10. ConfigurationHelper.resolvePlaceHolders( settingsCopy );
  11. for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class ).getIntegrators() ) {
  12. if ( ServiceContributingIntegrator.class.isInstance( integrator ) ) {
  13. ServiceContributingIntegrator.class.cast( integrator ).prepareServices( this );
  14. }
  15. }
  16. return new StandardServiceRegistryImpl( bootstrapServiceRegistry, initiators, providedServices, settingsCopy );
  17. }

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

  1. /**
  2. * Build the service registry accounting for all settings and service initiators and services.
  3. *
  4. * @return The built service registry
  5. */
  6. public ServiceRegistry buildServiceRegistry() {
  7. Map<?,?> settingsCopy = new HashMap();
  8. settingsCopy.putAll( settings );
  9. Environment.verifyProperties( settingsCopy );
  10. ConfigurationHelper.resolvePlaceHolders( settingsCopy );
  11. for ( Integrator integrator : bootstrapServiceRegistry.getService( IntegratorService.class ).getIntegrators() ) {
  12. if ( ServiceContributingIntegrator.class.isInstance( integrator ) ) {
  13. ServiceContributingIntegrator.class.cast( integrator ).prepareServices( this );
  14. }
  15. }
  16. return new StandardServiceRegistryImpl( bootstrapServiceRegistry, initiators, providedServices, settingsCopy );
  17. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  1. /**
  2. * Create a {@link SessionFactory} using the properties and mappings in this configuration. The
  3. * {@link SessionFactory} will be immutable, so changes made to {@code this} {@link Configuration} after
  4. * building the {@link SessionFactory} will not affect it.
  5. *
  6. * @return The build {@link SessionFactory}
  7. *
  8. * @throws HibernateException usually indicates an invalid configuration or invalid mapping information
  9. *
  10. * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
  11. */
  12. public SessionFactory buildSessionFactory() throws HibernateException {
  13. Environment.verifyProperties( properties );
  14. ConfigurationHelper.resolvePlaceHolders( properties );
  15. final ServiceRegistry serviceRegistry = new ServiceRegistryBuilder()
  16. .applySettings( properties )
  17. .buildServiceRegistry();
  18. setSessionFactoryObserver(
  19. new SessionFactoryObserver() {
  20. @Override
  21. public void sessionFactoryCreated(SessionFactory factory) {
  22. }
  23. @Override
  24. public void sessionFactoryClosed(SessionFactory factory) {
  25. ( (StandardServiceRegistryImpl) serviceRegistry ).destroy();
  26. }
  27. }
  28. );
  29. return buildSessionFactory( serviceRegistry );
  30. }

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

  1. /**
  2. * Create a {@link SessionFactory} using the properties and mappings in this configuration. The
  3. * {@link SessionFactory} will be immutable, so changes made to {@code this} {@link Configuration} after
  4. * building the {@link SessionFactory} will not affect it.
  5. *
  6. * @return The build {@link SessionFactory}
  7. *
  8. * @throws HibernateException usually indicates an invalid configuration or invalid mapping information
  9. *
  10. * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
  11. */
  12. public SessionFactory buildSessionFactory() throws HibernateException {
  13. Environment.verifyProperties( properties );
  14. ConfigurationHelper.resolvePlaceHolders( properties );
  15. final ServiceRegistry serviceRegistry = new ServiceRegistryBuilder()
  16. .applySettings( properties )
  17. .buildServiceRegistry();
  18. setSessionFactoryObserver(
  19. new SessionFactoryObserver() {
  20. @Override
  21. public void sessionFactoryCreated(SessionFactory factory) {
  22. }
  23. @Override
  24. public void sessionFactoryClosed(SessionFactory factory) {
  25. ( (StandardServiceRegistryImpl) serviceRegistry ).destroy();
  26. }
  27. }
  28. );
  29. return buildSessionFactory( serviceRegistry );
  30. }

相关文章