HibernateMetrics.java 文件源码

java
阅读 32 收藏 0 点赞 0 评论 0

项目:micrometer 作者:
/**
 * Get the {@code Statistics} object from the underlying {@code SessionFactory}. If it isn't hibernate that is
 * used return {@code null}.
 *
 * @param emf an {@code EntityManagerFactory}
 * @return the {@code Statistics} from the underlying {@code SessionFactory} or {@code null}.
 */
private Statistics getStatistics(EntityManagerFactory emf) {
    try {
        SessionFactory sf = emf.unwrap(SessionFactory.class);
        return sf.getStatistics();
    } catch (PersistenceException pe) {
        return null;
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号