Java 类org.hibernate.Version 实例源码

项目:HikariCP    文件:HikariConnectionProvider.java   
/**
 * c-tor
 */
public HikariConnectionProvider()
{
   this.hcfg = null;
   this.hds = null;
   if (Version.getVersionString().substring(0, 5).compareTo("4.3.6") >= 1) {
      LOGGER.warn("com.zaxxer.hikari.hibernate.HikariConnectionProvider has been deprecated for versions of "
                  + "Hibernate 4.3.6 and newer.  Please switch to org.hibernate.hikaricp.internal.HikariCPConnectionProvider.");
   }
}
项目:HotswapAgent    文件:Hibernate3JPAHelper.java   
/**
 * Inits the plugin.
 *
 * @param original the original
 */
// call initializePlugin and setup version and EJB flag
private static void initPlugin(EntityManagerFactory original) {
    ClassLoader appClassLoader = original.getClass().getClassLoader();

    String version = Version.getVersionString();

    PluginManagerInvoker.callInitializePlugin(Hibernate3JPAPlugin.class, appClassLoader);
    PluginManagerInvoker.callPluginMethod(Hibernate3JPAPlugin.class, appClassLoader, "init", new Class[] { String.class, Boolean.class }, new Object[] { version, true });

}
项目:HotswapAgent    文件:HibernatePersistenceHelper.java   
private static void initPlugin(EntityManagerFactory original) {
    ClassLoader appClassLoader = original.getClass().getClassLoader();

    String version = Version.getVersionString();

    PluginManagerInvoker.callInitializePlugin(HibernatePlugin.class, appClassLoader);
    PluginManagerInvoker.callPluginMethod(HibernatePlugin.class, appClassLoader,
            "init",
            new Class[]{String.class, Boolean.class},
            new Object[]{version, true});

}
项目:HotswapAgent    文件:HibernatePluginTest.java   
@BeforeClass
public static void setup() throws Exception {
    String[] version = Version.getVersionString().split("\\.");
    boolean version52OrGreater = Integer.valueOf(version[0]) == 5 && Integer.valueOf(version[1]) >= 2;
    if (version52OrGreater) {
        entityManagerFactory = Persistence.createEntityManagerFactory("TestPU52");
    }  else {
        entityManagerFactory = Persistence.createEntityManagerFactory("TestPU");
    }
}