Author: max.andersen(a)jboss.com
Date: 2006-10-31 08:23:35 -0500 (Tue, 31 Oct 2006)
New Revision: 10664
Modified:
branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java
Log:
dont change case for strings that requires quoting
Modified:
branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java
===================================================================
---
branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java 2006-10-31
13:22:51 UTC (rev 10663)
+++
branches/Branch_3_2/HibernateExt/tools/src/java/org/hibernate/cfg/reveng/dialect/AbstractMetaDataDialect.java 2006-10-31
13:23:35 UTC (rev 10664)
@@ -30,10 +30,10 @@
private Connection connection;
private DatabaseMetaData metaData;
+
public void configure(ConnectionProvider provider, SQLExceptionConverter sec) {
this.provider = provider;
- this.sec = sec;
-
+ this.sec = sec;
}
@@ -134,7 +134,9 @@
public boolean needQuote(String name) {
- // TODO: use jdbc metadata to decide on this. but for now we just handle the most
typical cases.
+ if(name==null) return false;
+
+ // TODO: use jdbc metadata to decide on this. but for now we just handle the most
typical cases.
if(name.indexOf('-')>0) return true;
if(name.indexOf(' ')>0) return true;
return false;
@@ -142,6 +144,9 @@
protected String caseForSearch(String value) throws SQLException {
// TODO: handle quoted requests (just strip it ?)
+ if(needQuote(value)) {
+ return value;
+ }
if ( getMetaData().storesUpperCaseIdentifiers() ) {
return StringHelper.toUpperCase( value );
} else if( getMetaData().storesUpperCaseIdentifiers() ) {
Show replies by date