Java Mailing List Archive

http://www.gg3721.com/

Home » Hibernate Commits List »

[hibernate-commits] Hibernate SVN: r15296 -
 core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/util.

hibernate-commits

2008-10-08


Author LoginPost Reply
Author: gbadner
Date: 2008-10-08 21:31:40 -0400 (Wed, 08 Oct 2008)
New Revision: 15296

Modified:
 core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/util/StringHelper.java
Log:
JBPAPP-1065 - Quoting clashes with defaults in NamingStrategy


Modified: core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/util/StringHelper.java
===================================================================
--- core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/util/StringHelper.java  2008-10-08 23:09:58 UTC (rev 15295)
+++ core/branches/Branch_3_2_4_SP1_CP/src/org/hibernate/util/StringHelper.java  2008-10-09 01:31:40 UTC (rev 15296)
@@(protected) @@
   return filter;
 }
 
+  public static boolean isQuoted(String name) {
+    return name != null && name.length() != 0 && name.charAt( 0 ) == '`';
+  }
+
+  public static String quote(String name) {
+    if ( name == null || name.length() == 0 || isQuoted( name ) ) {
+      return name;
+    }
+    else {
+      return new StringBuffer( name.length() + 2 ).append('`').append( name ).append( '`' ).toString();
+    }
+  }
+
+  public static String unquote(String name) {
+    if ( isQuoted( name ) ) {
+      return name.substring( 1, name.length() - 1 );
+    }
+    else {
+      return name;
+    }
+  }
}

_______________________________________________
hibernate-commits mailing list
hibernate-commits@(protected)
https://lists.jboss.org/mailman/listinfo/hibernate-commits
©2008 gg3721.com - Jax Systems, LLC, U.S.A.