Package org.hibernate.internal.jaxb.cfg

Examples of org.hibernate.internal.jaxb.cfg.JaxbHibernateConfiguration


    {
      final String cfgXmlResourceName = (String) merged.remove( AvailableSettings.CFG_FILE );
      if ( StringHelper.isNotEmpty( cfgXmlResourceName ) ) {
        // it does, so load those properties
        JaxbHibernateConfiguration configurationElement = configLoaderHolder.getValue()
            .loadConfigXmlResource( cfgXmlResourceName );
        processHibernateConfigurationElement( configurationElement, merged );
      }
    }

    // see if integration settings named a Hibernate config file....
    {
      final String cfgXmlResourceName = (String) integrationSettings.get( AvailableSettings.CFG_FILE );
      if ( StringHelper.isNotEmpty( cfgXmlResourceName ) ) {
        integrationSettings.remove( AvailableSettings.CFG_FILE );
        // it does, so load those properties
        JaxbHibernateConfiguration configurationElement = configLoaderHolder.getValue().loadConfigXmlResource(
            cfgXmlResourceName
        );
        processHibernateConfigurationElement( configurationElement, merged );
      }
    }
View Full Code Here


    );

    final String cfgXmlResourceName1 = (String) merged.remove( AvailableSettings.CFG_FILE );
    if ( StringHelper.isNotEmpty( cfgXmlResourceName1 ) ) {
      // it does, so load those properties
      JaxbHibernateConfiguration configurationElement = configLoaderHolder.getValue()
          .loadConfigXmlResource( cfgXmlResourceName1 );
      processHibernateConfigurationElement( configurationElement, merged );
    }

    // see if integration settings named a Hibernate config file....
    final String cfgXmlResourceName2 = (String) integrationSettings.get( AvailableSettings.CFG_FILE );
    if ( StringHelper.isNotEmpty( cfgXmlResourceName2 ) ) {
      integrationSettings.remove( AvailableSettings.CFG_FILE );
      // it does, so load those properties
      JaxbHibernateConfiguration configurationElement = configLoaderHolder.getValue().loadConfigXmlResource(
          cfgXmlResourceName2
      );
      processHibernateConfigurationElement( configurationElement, merged );
    }
View Full Code Here

   * @see #loadProperties(String)
   */
  @SuppressWarnings( {"unchecked"})
  public ServiceRegistryBuilder configure(String resourceName) {
    InputStream stream = bootstrapServiceRegistry.getService( ClassLoaderService.class ).locateResourceStream( resourceName );
    JaxbHibernateConfiguration configurationElement = jaxbProcessorHolder.getValue().unmarshal(
        stream,
        new Origin( SourceType.RESOURCE, resourceName )
    );
    for ( JaxbHibernateConfiguration.JaxbSessionFactory.JaxbProperty xmlProperty : configurationElement.getSessionFactory().getProperty() ) {
      settings.put( xmlProperty.getName(), xmlProperty.getValue() );
    }

    return this;
  }
View Full Code Here

TOP

Related Classes of org.hibernate.internal.jaxb.cfg.JaxbHibernateConfiguration

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.