OPENJPA-399. Committing Teresa's most recent patch for this Issue. Should be ready for resolution now.

git-svn-id: https://svn.apache.org/repos/asf/openjpa/trunk@585774 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Kevin W. Sutter 2007-10-18 01:37:58 +00:00
parent aca5f3351d
commit a20d36c121
4 changed files with 24 additions and 6 deletions

View File

@ -819,8 +819,10 @@ public class SchemaGenerator {
if (_log.isTraceEnabled()) if (_log.isTraceEnabled())
_log.trace(_loc.get("gen-seqs", schemaName, sequenceName)); _log.trace(_loc.get("gen-seqs", schemaName, sequenceName));
// since all the sequences are generated under the default schema
// therefore, we can use the null schemaname to search
Sequence[] seqs = _dict.getSequences(meta, conn.getCatalog(), Sequence[] seqs = _dict.getSequences(meta, conn.getCatalog(),
schemaName, sequenceName, conn); null, sequenceName, conn);
SchemaGroup group = getSchemaGroup(); SchemaGroup group = getSchemaGroup();
Schema schema; Schema schema;

View File

@ -94,7 +94,7 @@ public class DB2Dictionary
"LONG VARCHAR FOR BIT DATA", "LONG VARCHAR", "LONG VARGRAPHIC", "LONG VARCHAR FOR BIT DATA", "LONG VARCHAR", "LONG VARGRAPHIC",
})); }));
systemSchemas = new String( systemSchemas = new String(
"SYSCAT, SYSIBM, SYSSTAT, SYSIBMADM, SYSTOOLS"); "SYSCAT,SYSIBM,SYSSTAT,SYSIBMADM,SYSTOOLS");
maxConstraintNameLength = 18; maxConstraintNameLength = 18;
maxIndexNameLength = 18; maxIndexNameLength = 18;
maxColumnNameLength = 30; maxColumnNameLength = 30;

View File

@ -3364,7 +3364,7 @@ public class DBDictionary
try { try {
int idx = 1; int idx = 1;
if (schemaName != null) if (schemaName != null)
stmnt.setString(idx++, schemaName); stmnt.setString(idx++, schemaName.toUpperCase());
if (sequenceName != null) if (sequenceName != null)
stmnt.setString(idx++, sequenceName); stmnt.setString(idx++, sequenceName);
@ -3708,13 +3708,21 @@ public class DBDictionary
if (objectName == null) if (objectName == null)
return null; return null;
if (SCHEMA_CASE_LOWER.equals(schemaCase)) String scase = getSchemaCase();
if (SCHEMA_CASE_LOWER.equals(scase))
return objectName.toLowerCase(); return objectName.toLowerCase();
if (SCHEMA_CASE_PRESERVE.equals(schemaCase)) if (SCHEMA_CASE_PRESERVE.equals(scase))
return objectName; return objectName;
return objectName.toUpperCase(); return objectName.toUpperCase();
} }
/**
* Return DB specific schemaCase
*/
public String getSchemaCase(){
return schemaCase;
}
/** /**
* Prepared the connection for metadata operations. * Prepared the connection for metadata operations.
*/ */

View File

@ -42,6 +42,7 @@ public class SQLServerDictionary
private static final Localizer _loc = Localizer.forPackage private static final Localizer _loc = Localizer.forPackage
(SQLServerDictionary.class); (SQLServerDictionary.class);
private String schemaCase = SCHEMA_CASE_PRESERVE;
/** /**
* Flag whether to treat UNIQUEIDENTIFIER as VARBINARY or VARCHAR * Flag whether to treat UNIQUEIDENTIFIER as VARBINARY or VARCHAR
*/ */
@ -230,4 +231,11 @@ public class SQLServerDictionary
appendLength(buf, type); appendLength(buf, type);
buf.append("')"); buf.append("')");
} }
/**
* Return DB specific schemaCase
*/
public String getSchemaCase() {
return schemaCase;
}
} }