Author: steve.ebersole(a)jboss.com
Date: 2009-06-22 17:21:42 -0400 (Mon, 22 Jun 2009)
New Revision: 16869
Added:
core/branches/Branch_3_2/src/org/hibernate/Version.java
Modified:
core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java
Log:
HHH-3978 - Expose Hibernate version via non-compile-time constant expression
Added: core/branches/Branch_3_2/src/org/hibernate/Version.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/Version.java (rev
0)
+++ core/branches/Branch_3_2/src/org/hibernate/Version.java 2009-06-22 21:21:42 UTC (rev
16869)
@@ -0,0 +1,35 @@
+/*
+ * Hibernate, Relational Persistence for Idiomatic Java
+ *
+ * Copyright (c) 2009, Red Hat Middleware LLC or third-party contributors as
+ * indicated by the @author tags or express copyright attribution
+ * statements applied by the authors. All third-party contributions are
+ * distributed under license by Red Hat Middleware LLC.
+ *
+ * This copyrighted material is made available to anyone wishing to use, modify,
+ * copy, or redistribute it subject to the terms and conditions of the GNU
+ * Lesser General Public License, as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+ * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
+ * for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this distribution; if not, write to:
+ * Free Software Foundation, Inc.
+ * 51 Franklin Street, Fifth Floor
+ * Boston, MA 02110-1301 USA
+ */
+package org.hibernate;
+
+/**
+ * Information about the Hibernate version.
+ *
+ * @author Steve Ebersole
+ */
+public class Version {
+ public static String getVersionString() {
+ return "3.2.8-SNAPSHOT";
+ }
+}
Modified: core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java
===================================================================
--- core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java 2009-06-22 21:21:25
UTC (rev 16868)
+++ core/branches/Branch_3_2/src/org/hibernate/cfg/Environment.java 2009-06-22 21:21:42
UTC (rev 16869)
@@ -15,6 +15,7 @@
import org.apache.commons.logging.LogFactory;
import org.hibernate.HibernateException;
+import org.hibernate.Version;
import org.hibernate.bytecode.BytecodeProvider;
import org.hibernate.util.ConfigHelper;
import org.hibernate.util.PropertiesHelper;
@@ -153,7 +154,14 @@
*/
public final class Environment {
- public static final String VERSION = "3.2.8-SNAPSHOT";
+ /**
+ * The Hibernate version.
+ *
+ * @deprecated To be removed in 3.5. Use Version#getVersionString instead. See
+ * <a
href="http://java.sun.com/docs/books/jls/third_edition/html/binaryCo...
Language Specification</a>
+ * for details about compile-time constant expression for the reasons why this is being
removed.
+ */
+ public static final String VERSION = Version.getVersionString();
/**
* <tt>ConnectionProvider</tt> implementor to use when obtaining
connections