IDEMPIERE-2664 DB Extensibility issues / remove calls to DB.isPostgreSQL and DB.isOracle to determine if identifiers are upper/lower-case
This commit is contained in:
parent
8228607b35
commit
1fc8f9cb95
|
@ -212,13 +212,7 @@ public class TableCreateColumns extends SvrProcess
|
|||
*/
|
||||
private void addTableColumn (ResultSet rs, MTable table) throws Exception
|
||||
{
|
||||
String tableName = table.getTableName ();
|
||||
if (DB.isOracle ())
|
||||
tableName = tableName.toUpperCase ();
|
||||
// globalqss 2005-10-24
|
||||
if (DB.isPostgreSQL())
|
||||
tableName = tableName.toLowerCase();
|
||||
// end globalqss 2005-10-24
|
||||
String tableName = table.getTableName();
|
||||
while (rs.next ())
|
||||
{
|
||||
String tn = rs.getString ("TABLE_NAME");
|
||||
|
|
|
@ -2415,7 +2415,14 @@ public final class DB
|
|||
ResultSet rs = null;
|
||||
try {
|
||||
DatabaseMetaData metadata = conn.getMetaData();
|
||||
rs = metadata.getTables(null, null, (DB.isPostgreSQL() ? tableName.toLowerCase() : tableName.toUpperCase()), null);
|
||||
String tblName;
|
||||
if (metadata.storesUpperCaseIdentifiers())
|
||||
tblName = tableName.toUpperCase();
|
||||
else if (metadata.storesLowerCaseIdentifiers())
|
||||
tblName = tableName.toLowerCase();
|
||||
else
|
||||
tblName = tableName;
|
||||
rs = metadata.getTables(null, null, tblName, null);
|
||||
if (rs.next()) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -216,10 +216,10 @@ public class ColumnElementHandler extends AbstractElementHandler {
|
|||
String schema = DB.getDatabase().getSchema();
|
||||
String tableName = table.getTableName();
|
||||
String columnName = column.getColumnName();
|
||||
if (DB.isOracle()) {
|
||||
if (md.storesUpperCaseIdentifiers()) {
|
||||
tableName = tableName.toUpperCase();
|
||||
columnName = columnName.toUpperCase();
|
||||
} else if (DB.isPostgreSQL()) {
|
||||
} else if (md.storesLowerCaseIdentifiers()) {
|
||||
tableName = tableName.toLowerCase();
|
||||
columnName = columnName.toLowerCase();
|
||||
}
|
||||
|
|
|
@ -309,10 +309,10 @@ public class ColumnElementHandler extends AbstractElementHandler {
|
|||
String schema = DB.getDatabase().getSchema();
|
||||
String tableName = table.getTableName();
|
||||
String columnName = column.getColumnName();
|
||||
if (DB.isOracle()) {
|
||||
if (md.storesUpperCaseIdentifiers()) {
|
||||
tableName = tableName.toUpperCase();
|
||||
columnName = columnName.toUpperCase();
|
||||
} else if (DB.isPostgreSQL()) {
|
||||
} else if (md.storesLowerCaseIdentifiers()) {
|
||||
tableName = tableName.toLowerCase();
|
||||
columnName = columnName.toLowerCase();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue