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

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

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

Configuration.setCollectionCacheConcurrencyStrategy介绍

[英]Set up a cache for a collection role
[中]为集合角色设置缓存

代码示例

代码示例来源:origin: org.hibernate/hibernate-annotations

@Override
public AnnotationConfiguration setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy)
    throws MappingException {
  super.setCollectionCacheConcurrencyStrategy( collectionRole, concurrencyStrategy );
  return this;
}

代码示例来源:origin: org.hibernate/hibernate-annotations

super.setCollectionCacheConcurrencyStrategy( cacheHolder.role, cacheHolder.usage, cacheHolder.region );

代码示例来源:origin: org.ow2.bonita/bonita-pvm

public void apply(Object target, WireContext wireContext) {
 Configuration configuration = (Configuration) target;
 configuration.setCollectionCacheConcurrencyStrategy(collection,
   concurrencyStrategy);
}

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

/**
 * Set up a cache for a collection role
 *
 * @param collectionRole The name of the collection to which we should associate these cache settings
 * @param concurrencyStrategy The cache strategy to use
 *
 * @return this for method chaining
 */
public Configuration setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy) {
  setCollectionCacheConcurrencyStrategy( collectionRole, concurrencyStrategy, collectionRole );
  return this;
}

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

/**
 * Set up a cache for a collection role
 *
 * @param collectionRole The name of the collection to which we should associate these cache settings
 * @param concurrencyStrategy The cache strategy to use
 *
 * @return this for method chaining
 */
public Configuration setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy) {
  setCollectionCacheConcurrencyStrategy( collectionRole, concurrencyStrategy, collectionRole );
  return this;
}

代码示例来源:origin: org.jbpm/pvm

public void apply(Object target, WireContext wireContext) {
 Configuration configuration = (Configuration) target;
 configuration.setCollectionCacheConcurrencyStrategy(collection, concurrencyStrategy);
}
public String toString() {

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

@Override
public AnnotationConfiguration setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy)
    throws MappingException {
  super.setCollectionCacheConcurrencyStrategy( collectionRole, concurrencyStrategy );
  return this;
}

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

@Override
public AnnotationConfiguration setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy)
    throws MappingException {
  super.setCollectionCacheConcurrencyStrategy( collectionRole, concurrencyStrategy );
  return this;
}

代码示例来源:origin: org.ow2.bonita/bonita-server

@Override
public void apply(final Object target, final WireContext wireContext) {
 final Configuration configuration = (Configuration) target;
 configuration.setCollectionCacheConcurrencyStrategy(collection, concurrencyStrategy);
}

代码示例来源:origin: babyfish-ct/babyfish

@Override
public Configuration setCollectionCacheConcurrencyStrategy(
    String collectionRole, String concurrencyStrategy) {
  super.setCollectionCacheConcurrencyStrategy(collectionRole,
      concurrencyStrategy);
  return this;
}

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

/**
 * Set up a cache for a collection role
 *
 * @param collectionRole
 * @param concurrencyStrategy
 * @return Configuration
 * @throws MappingException
 */
public Configuration setCollectionCacheConcurrencyStrategy(String collectionRole, String concurrencyStrategy)
    throws MappingException {
  setCollectionCacheConcurrencyStrategy( collectionRole, concurrencyStrategy, collectionRole );
  return this;
}

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

cfg.setCollectionCacheConcurrencyStrategy( role, usage, region );

代码示例来源: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 );
    }
  }
}

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

super.setCollectionCacheConcurrencyStrategy( cacheHolder.role, cacheHolder.usage, cacheHolder.region );

代码示例来源:origin: apache/servicemix-bundles

StringUtils.commaDelimitedListToStringArray(this.collectionCacheStrategies.getProperty(collRole));
if (strategyAndRegion.length > 1) {
  config.setCollectionCacheConcurrencyStrategy(collRole, strategyAndRegion[0], strategyAndRegion[1]);
  config.setCollectionCacheConcurrencyStrategy(collRole, strategyAndRegion[0]);

相关文章

Configuration类方法