/** {@inheritDoc} **/ @SuppressWarnings("rawtypes") public Map getAllCollectionMetadata() { return delegate.getAllCollectionMetadata(); }
/** {@inheritDoc} **/ @SuppressWarnings("unchecked") public Map getAllCollectionMetadata() { return delegate.getAllCollectionMetadata(); }
@Override public Map getAllCollectionMetadata() { return delegate.getAllCollectionMetadata(); }
@Deprecated @Override public Map getAllCollectionMetadata() { return delegate.getAllCollectionMetadata(); }
@SuppressWarnings("unchecked") public Map getAllCollectionMetadata() throws HibernateException { return getSessionFactory().getAllCollectionMetadata(); }
/** * 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; }
/** * 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; }
public Map getAllCollectionMetadata() throws HibernateException { return getImpl().getAllCollectionMetadata(); }
public Map getAllCollectionMetadata() throws HibernateException { return getImpl().getAllCollectionMetadata(); }
public Map getAllCollectionMetadata() throws HibernateException { return getSessionFactory().getAllCollectionMetadata(); }
public Map getAllCollectionMetadata() throws HibernateException { return getImpl().getAllCollectionMetadata(); }
public Map getAllCollectionMetadata() { return getCurrentSessionFactory().getAllCollectionMetadata(); }
public Map getAllCollectionMetadata() throws HibernateException { return getImpl().getAllCollectionMetadata(); }
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); } }
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; } }
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(); } }
Map<String, CollectionMetadata> allCollectionMetadata = sessionfactory.getAllCollectionMetadata();