org.hibernate.SessionFactory.getAllCollectionMetadata()方法的使用及代码示例

x33g5p2x  于2022-01-29 转载在 其他  
字(5.4k)|赞(0)|评价(0)|浏览(174)

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

SessionFactory.getAllCollectionMetadata介绍

[英]Get the CollectionMetadata for all mapped collections.
[中]获取所有映射集合的CollectionMetadata。

代码示例

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

/** {@inheritDoc} **/
@SuppressWarnings("rawtypes")
public Map getAllCollectionMetadata() {
  return delegate.getAllCollectionMetadata();
}

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

/** {@inheritDoc} **/
@SuppressWarnings("unchecked")
public Map getAllCollectionMetadata() {
  return delegate.getAllCollectionMetadata();
}

代码示例来源:origin: org.codehaus.griffon.plugins/griffon-hibernate4-core

@Override
public Map getAllCollectionMetadata() {
  return delegate.getAllCollectionMetadata();
}

代码示例来源:origin: org.codehaus.griffon.plugins/griffon-hibernate5-core

@Deprecated
@Override
public Map getAllCollectionMetadata() {
  return delegate.getAllCollectionMetadata();
}

代码示例来源:origin: org.jboss.ejb3/jboss-ejb3-jpa-int

@SuppressWarnings("unchecked")
public Map getAllCollectionMetadata() throws HibernateException
{
 return getSessionFactory().getAllCollectionMetadata();
}

代码示例来源:origin: spring-projects/spring-flex

/**
 * Extracts all {@link ClassMetadata} and {@link CollectionMetadata} from a given {@link SessionFactory} to be 
 * used in determining the types that need a {@link org.springframework.flex.core.io.SpringPropertyProxy} registered in {@link #findTypesToRegister()}
 * @param sessionFactory the session factory from which to read metadata
 */
@SuppressWarnings("unchecked")
protected void extractHibernateMetadata(SessionFactory sessionFactory) {
  this.classMetadata.addAll(sessionFactory.getAllClassMetadata().values());
  this.collectionMetadata.addAll(sessionFactory.getAllCollectionMetadata().values());
  this.hibernateConfigured = true;
}

代码示例来源:origin: spring-projects/spring-flex

/**
 * Extracts all {@link ClassMetadata} and {@link CollectionMetadata} from a given {@link SessionFactory} to be 
 * used in determining the types that need a {@link org.springframework.flex.core.io.SpringPropertyProxy} registered in {@link #findTypesToRegister()}
 * @param sessionFactory the session factory from which to read metadata
 */
@SuppressWarnings("unchecked")
protected void extractHibernateMetadata(SessionFactory sessionFactory) {
  this.classMetadata.addAll(sessionFactory.getAllClassMetadata().values());
  this.collectionMetadata.addAll(sessionFactory.getAllCollectionMetadata().values());
  this.hibernateConfigured = true;
}

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

public Map getAllCollectionMetadata() throws HibernateException {
  return getImpl().getAllCollectionMetadata();
}

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

public Map getAllCollectionMetadata() throws HibernateException {
  return getImpl().getAllCollectionMetadata();
}

代码示例来源:origin: com.carbonfive/db-support

public Map getAllCollectionMetadata() throws HibernateException
{
  return getSessionFactory().getAllCollectionMetadata();
}

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

public Map getAllCollectionMetadata() throws HibernateException {
  return getImpl().getAllCollectionMetadata();
}

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

public Map getAllCollectionMetadata() {
  return getCurrentSessionFactory().getAllCollectionMetadata();
}

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

public Map getAllCollectionMetadata() throws HibernateException {
  return getImpl().getAllCollectionMetadata();
}

代码示例来源:origin: org.jbpm.jbpm3/jbpm-jpdl

public static void clearHibernateCache(SessionFactory sessionFactory) {
 sessionFactory.evictQueries();
 Map classMetadata = sessionFactory.getAllClassMetadata();
 for (Iterator iter = classMetadata.keySet().iterator(); iter.hasNext();) {
  String entityName = (String) iter.next();
  sessionFactory.evictEntity(entityName);
 }
 Map collectionMetadata = sessionFactory.getAllCollectionMetadata();
 for (Iterator iter = collectionMetadata.keySet().iterator(); iter.hasNext();) {
  String collectionName = (String) iter.next();
  sessionFactory.evictCollection(collectionName);
 }
}

代码示例来源:origin: stackoverflow.com

import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateUtil {
  private static final SessionFactory sessionFactory;
  static {
    try {
      sessionFactory = new AnnotationConfiguration().configure()
          .buildSessionFactory();
      System.out.println("session Factory = "+sessionFactory.toString()+" current session="+sessionFactory.getCurrentSession()+
          " collection="+sessionFactory.getAllCollectionMetadata()+" collection="+sessionFactory.getStatistics());
    } catch (Throwable ex) {
      System.err.println("Initial SessionFactory creation failed." + ex);
      throw new ExceptionInInitializerError(ex);
    }
  }

  public static SessionFactory getSessionFactory() {
    return sessionFactory;
  }
}

代码示例来源:origin: com.carbonfive/db-support

public static void clearSecondLevelCache(SessionFactory sessionFactory) throws HibernateException
  {
    for (String clazz : (Set<String>) sessionFactory.getAllClassMetadata().keySet())
    {
      sessionFactory.evictEntity(clazz);
    }
    for (String rolename : (Set<String>) sessionFactory.getAllCollectionMetadata().keySet())
    {
      sessionFactory.evictCollection(rolename);
    }
    sessionFactory.evictQueries();
  }
}

代码示例来源:origin: stackoverflow.com

Map<String, CollectionMetadata> allCollectionMetadata = sessionfactory.getAllCollectionMetadata();

相关文章