org.hibernate.stat.Statistics.getCollectionRoleNames()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(10.1k)|赞(0)|评价(0)|浏览(82)

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

Statistics.getCollectionRoleNames介绍

[英]Get the names of all collection roles
[中]获取所有集合角色的名称

代码示例

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

@Override
public Collection<String> getDynamicChildrenNames(
    EntityManagerFactoryAccess entityManagerFactoryLookup,
    PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics( entityManagerFactoryLookup.entityManagerFactory(
      pathAddress.getValue( HibernateStatistics.PROVIDER_LABEL ) ) );
  if ( stats == null ) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection( Arrays.asList( stats.getCollectionRoleNames() ) );
}

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

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL)));
  if (stats == null) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection(Arrays.asList(stats.getCollectionRoleNames()));
}

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

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL)));
  if (stats == null) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection(Arrays.asList(stats.getCollectionRoleNames()));
}

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

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL)));
  if (stats == null) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection(Arrays.asList(stats.getCollectionRoleNames()));
}

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

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL)));
  if (stats == null) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection(Arrays.asList(stats.getCollectionRoleNames()));
}

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

json.put("RoleStatistics", roleStatistics);
String[] roleNames = statistics.getCollectionRoleNames();
for (String roleName : roleNames) {
  roleStatistics.put(roleName, statistics.getCollectionStatistics(roleName));

代码示例来源:origin: net.sf.ehcache/ehcache

/**
 * {@inheritDoc}
 * 
 * @see net.sf.ehcache.hibernate.management.api.HibernateStats#getCollectionStats()
 */
public TabularData getCollectionStats() {
  List<CompositeData> result = new ArrayList<CompositeData>();
  Statistics statistics = getStatistics();
  for (String roleName : statistics.getCollectionRoleNames()) {
    CollectionStats collectionStats = new CollectionStats(roleName, statistics.getCollectionStatistics(roleName));
    result.add(collectionStats.toCompositeData());
  }
  TabularData td = CollectionStats.newTabularDataInstance();
  td.putAll(result.toArray(new CompositeData[result.size()]));
  return td;
}

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

public String[] getCollectionRoleNames() {
  return stats.getCollectionRoleNames();
}

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

public String[] getCollectionRoleNames() {
  return stats.getCollectionRoleNames();
}

代码示例来源:origin: org.jboss.as/jboss-as-jpa-hibernate4

private Set<String> getCollectionNames() {
  final Statistics stats = getStatistics();
  if (stats == null) {
    return Collections.emptySet();
  } else {
    Set<String> result = new HashSet<String>();
    String[] collectionNames = stats.getCollectionRoleNames();
    if (collectionNames != null) {
      for (String entity : collectionNames) {
        result.add(entity);
      }
    }
    return result;
  }
}

代码示例来源:origin: org.jboss.eap/jipijapa-hibernate4-3

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL)));
  if (stats == null) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection(Arrays.asList(stats.getCollectionRoleNames()));
}

代码示例来源:origin: org.jboss.eap/jipijapa-hibernate5

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL)));
  if (stats == null) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection(Arrays.asList(stats.getCollectionRoleNames()));
}

代码示例来源:origin: org.jboss.eap/jipijapa-hibernate5-3

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  org.hibernate.stat.Statistics stats = getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL)));
  if (stats == null) {
    return Collections.emptyList();
  }
  return Collections.unmodifiableCollection(Arrays.asList(stats.getCollectionRoleNames()));
}

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-3

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  return Collections.unmodifiableCollection(Arrays.asList(
      getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))).getCollectionRoleNames()));
}

代码示例来源:origin: org.jipijapa/jipijapa-hibernate4-1

@Override
public Collection<String> getDynamicChildrenNames(EntityManagerFactoryAccess entityManagerFactoryLookup, PathAddress pathAddress) {
  return Collections.unmodifiableCollection(Arrays.asList(
      getBaseStatistics(entityManagerFactoryLookup.entityManagerFactory(pathAddress.getValue(HibernateStatistics.PROVIDER_LABEL))).getCollectionRoleNames()));
}

代码示例来源:origin: at.chrl/chrl-orm

public static String[] getCollectionStatistics(final IHibernateConfig hconfig) {
  if (isNull(hconfig))
    throw new NullPointerException("Parameter hconfig is null");
  SessionFactory sf = HibernateService.getInstance().getSessionFactory(hconfig);
  if (isNull(sf))
    throw new NullPointerException("Could not obtain SessionFactory for Config: " + hconfig);
  final Statistics stats = sf.getStatistics();
  String[] header = new String[] { JVMInfoUtil.getInstance().printSection("Collections for: " + hconfig.toString()) };
  return Arrays.stream(stats.getCollectionRoleNames()).reduce(header, (a, s) -> ArrayUtils.addAll(a, getCollectionStatistics(sf, s)), ArrayUtils::addAll);
}

代码示例来源:origin: org.terracotta.modules/tim-hibernate-cache-provider-3.2

public TabularData getCollectionStats() {
 List<CompositeData> result = new ArrayList<CompositeData>();
 for (String roleName : statistics.getCollectionRoleNames()) {
  CollectionStats collectionStats = new CollectionStats(roleName, statistics.getCollectionStatistics(roleName));
  result.add(collectionStats.toCompositeData());
 }
 TabularData td = CollectionStats.newTabularDataInstance();
 td.putAll(result.toArray(new CompositeData[result.size()]));
 return td;
}

代码示例来源:origin: at.chrl/chrl-orm

public static String[] getCollectionStatistics(final SessionFactory sessionFactory, final String collectionRoleName) {
  if (isNull(sessionFactory))
    throw new NullPointerException("Parameter sessionFactory is null");
  if (isNull(collectionRoleName))
    throw new NullPointerException("Parameter collectionRoleName is null");
  if (collectionRoleName.isEmpty())
    throw new IllegalArgumentException("Parameter collectionRoleName is a empty String");
  final Statistics sfstats = sessionFactory.getStatistics();
  if (!ArrayUtils.contains(sfstats.getCollectionRoleNames(), collectionRoleName))
    throw new IllegalArgumentException("Collection Role " + collectionRoleName + " is not managed by given SessionFactory");
  final CollectionStatistics stats = sfstats.getCollectionStatistics(collectionRoleName);
  return new String[] { "+ Collection Statistics: " + collectionRoleName, "+", "+ Fetched: " + stats.getFetchCount(), "+ Recreated: " + stats.getRecreateCount(), "+ Loaded: " + stats.getLoadCount(), "+ Updated: " + stats.getUpdateCount(), "+ Removed: " + stats.getRemoveCount(), "+", "+" };
}

代码示例来源:origin: net.sf.ehcache.internal/ehcache-core

/**
 * {@inheritDoc}
 * 
 * @see net.sf.ehcache.hibernate.management.api.HibernateStats#getCollectionStats()
 */
public TabularData getCollectionStats() {
  List<CompositeData> result = new ArrayList<CompositeData>();
  Statistics statistics = getStatistics();
  for (String roleName : statistics.getCollectionRoleNames()) {
    CollectionStats collectionStats = new CollectionStats(roleName, statistics.getCollectionStatistics(roleName));
    result.add(collectionStats.toCompositeData());
  }
  TabularData td = CollectionStats.newTabularDataInstance();
  td.putAll(result.toArray(new CompositeData[result.size()]));
  return td;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.ehcache

/**
 * {@inheritDoc}
 * 
 * @see net.sf.ehcache.hibernate.management.api.HibernateStats#getCollectionStats()
 */
public TabularData getCollectionStats() {
  List<CompositeData> result = new ArrayList<CompositeData>();
  Statistics statistics = getStatistics();
  for (String roleName : statistics.getCollectionRoleNames()) {
    CollectionStats collectionStats = new CollectionStats(roleName, statistics.getCollectionStatistics(roleName));
    result.add(collectionStats.toCompositeData());
  }
  TabularData td = CollectionStats.newTabularDataInstance();
  td.putAll(result.toArray(new CompositeData[result.size()]));
  return td;
}

相关文章

Statistics类方法