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

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

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

Configuration.parseMappingElement介绍

暂无

代码示例

代码示例来源:origin: jboss.jboss-embeddable-ejb3/hibernate-all

private void parseSessionFactory(Element sfNode, String name) {
  Iterator elements = sfNode.elementIterator();
  while ( elements.hasNext() ) {
    Element subelement = (Element) elements.next();
    String subelementName = subelement.getName();
    if ( "mapping".equals( subelementName ) ) {
      parseMappingElement( subelement, name );
    }
    else if ( "class-cache".equals( subelementName ) ) {
      String className = subelement.attributeValue( "class" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? className : regionNode.getValue();
      boolean includeLazy = !"non-lazy".equals( subelement.attributeValue( "include" ) );
      setCacheConcurrencyStrategy( className, subelement.attributeValue( "usage" ), region, includeLazy );
    }
    else if ( "collection-cache".equals( subelementName ) ) {
      String role = subelement.attributeValue( "collection" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? role : regionNode.getValue();
      setCollectionCacheConcurrencyStrategy( role, subelement.attributeValue( "usage" ), region );
    }
    else if ( "listener".equals( subelementName ) ) {
      parseListener( subelement );
    }
    else if ( "event".equals( subelementName ) ) {
      parseEvent( subelement );
    }
  }
}

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

private void parseSessionFactory(Element sfNode, String name) {
  Iterator elements = sfNode.elementIterator();
  while ( elements.hasNext() ) {
    Element subelement = (Element) elements.next();
    String subelementName = subelement.getName();
    if ( "mapping".equals( subelementName ) ) {
      parseMappingElement( subelement, name );
    }
    else if ( "class-cache".equals( subelementName ) ) {
      String className = subelement.attributeValue( "class" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? className : regionNode.getValue();
      boolean includeLazy = !"non-lazy".equals( subelement.attributeValue( "include" ) );
      setCacheConcurrencyStrategy( className, subelement.attributeValue( "usage" ), region, includeLazy );
    }
    else if ( "collection-cache".equals( subelementName ) ) {
      String role = subelement.attributeValue( "collection" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? role : regionNode.getValue();
      setCollectionCacheConcurrencyStrategy( role, subelement.attributeValue( "usage" ), region );
    }
  }
}

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

private void parseSessionFactory(Element sfNode, String name) {
  Iterator elements = sfNode.elementIterator();
  while ( elements.hasNext() ) {
    Element subelement = (Element) elements.next();
    String subelementName = subelement.getName();
    if ( "mapping".equals( subelementName ) ) {
      parseMappingElement( subelement, name );
    }
    else if ( "class-cache".equals( subelementName ) ) {
      String className = subelement.attributeValue( "class" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? className : regionNode.getValue();
      boolean includeLazy = !"non-lazy".equals( subelement.attributeValue( "include" ) );
      setCacheConcurrencyStrategy( className, subelement.attributeValue( "usage" ), region, includeLazy );
    }
    else if ( "collection-cache".equals( subelementName ) ) {
      String role = subelement.attributeValue( "collection" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? role : regionNode.getValue();
      setCollectionCacheConcurrencyStrategy( role, subelement.attributeValue( "usage" ), region );
    }
  }
}

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

private void parseSessionFactory(Element sfNode, String name) {
  Iterator elements = sfNode.elementIterator();
  while ( elements.hasNext() ) {
    Element subelement = ( Element ) elements.next();
    String subelementName = subelement.getName();
    if ( "mapping".equals( subelementName ) ) {
      parseMappingElement(subelement, name);
    }
    else if ( "class-cache".equals( subelementName ) ) {
      String className = subelement.attributeValue( "class" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? className : regionNode.getValue();
      setCacheConcurrencyStrategy( className, subelement.attributeValue( "usage" ), region );
    }
    else if ( "collection-cache".equals( subelementName ) ) {
      String role = subelement.attributeValue( "collection" );
      Attribute regionNode = subelement.attribute( "region" );
      final String region = ( regionNode == null ) ? role : regionNode.getValue();
      setCollectionCacheConcurrencyStrategy( role, subelement.attributeValue( "usage" ), region );
    }
    else if ( "listener".equals( subelementName ) ) {
      parseListener( subelement );
    }
  }
}

相关文章

Configuration类方法