Skip to content

Commit

Permalink
[1948939] Mixed case table names on PostgreSQL
Browse files Browse the repository at this point in the history
  • Loading branch information
erilong committed Apr 22, 2008
1 parent 382764e commit 5c8bb95
Show file tree
Hide file tree
Showing 9 changed files with 27 additions and 23 deletions.
Expand Up @@ -264,9 +264,12 @@ public Object doInConnection(Connection c) throws SQLException, DataAccessExcept
metaData.setSchemaPattern(schema);
metaData.setTableTypes(null);
String tableName = _tableName;
if (!supportsMixedCaseNamesInCatalog()) {
if (storesUpperCaseNamesInCatalog()) {
tableName = _tableName.toUpperCase();
} else if (storesLowerCaseNamesInCatalog()) {
tableName = _tableName.toLowerCase();
}

ResultSet tableData = null;
try {
tableData = metaData.getTables(tableName);
Expand Down Expand Up @@ -846,6 +849,14 @@ public boolean isClobSyncSupported() {
public boolean isTransactionIdOverrideSupported() {
return true;
}

public boolean storesUpperCaseNamesInCatalog() {
return false;
}

public boolean storesLowerCaseNamesInCatalog() {
return false;
}

public void setSqlTemplate(SqlTemplate sqlTemplate) {
this.sqlTemplate = sqlTemplate;
Expand Down
Expand Up @@ -101,8 +101,10 @@ public void initTrigger(DataEventType dml, Trigger config,
*/
public int getMaxTriggerNameLength();

public boolean supportsMixedCaseNamesInCatalog();

public boolean storesUpperCaseNamesInCatalog();

public boolean storesLowerCaseNamesInCatalog();

public boolean supportsTransactionId();

public boolean requiresSavepointForFallback();
Expand Down
Expand Up @@ -100,8 +100,8 @@ public boolean isEmptyStringNulled() {
return false;
}

public boolean supportsMixedCaseNamesInCatalog() {
return false;
public boolean storesUpperCaseNamesInCatalog() {
return true;
}

public boolean supportsGetGeneratedKeys() {
Expand Down
Expand Up @@ -114,8 +114,8 @@ public boolean isEmptyStringNulled() {
return false;
}

public boolean supportsMixedCaseNamesInCatalog() {
return false;
public boolean storesUpperCaseNamesInCatalog() {
return true;
}

protected boolean allowsNullForIdentityColumn() {
Expand Down
Expand Up @@ -164,8 +164,8 @@ public boolean isEmptyStringNulled() {
return false;
}

public boolean supportsMixedCaseNamesInCatalog() {
return false;
public boolean storesUpperCaseNamesInCatalog() {
return true;
}

public boolean supportsGetGeneratedKeys() {
Expand Down
Expand Up @@ -183,13 +183,8 @@ public void removeTrigger(String schemaName, String triggerName) {
removeTrigger(schemaName, triggerName, null);
}

/**
* SQL Server is case insensitive.
* @return false always
*/
public boolean supportsMixedCaseNamesInCatalog() {
return false;
public boolean storesUpperCaseNamesInCatalog() {
return true;
}


}
Expand Up @@ -106,10 +106,6 @@ public boolean isEmptyStringNulled() {
return false;
}

public boolean supportsMixedCaseNamesInCatalog() {
return true;
}

public void purge() {
}

Expand Down
Expand Up @@ -116,8 +116,8 @@ protected boolean doesTriggerExistOnPlatform(String schema, String tableName,
new Object[] { triggerName, tableName }) > 0;
}

public boolean supportsMixedCaseNamesInCatalog() {
return false;
public boolean storesUpperCaseNamesInCatalog() {
return true;
}

public void purge() {
Expand Down
Expand Up @@ -127,7 +127,7 @@ public boolean isEmptyStringNulled() {
return false;
}

public boolean supportsMixedCaseNamesInCatalog() {
public boolean storesLowerCaseNamesInCatalog() {
return true;
}

Expand Down

0 comments on commit 5c8bb95

Please sign in to comment.