From d1ab1ad3e389dea153a6c6be026880ff55aa9727 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 23 Jul 2008 01:46:35 +0000 Subject: [PATCH] Fix [ 2025274 ] Identifier not shown in postgresql --- base/src/org/compiere/model/MLookupFactory.java | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/base/src/org/compiere/model/MLookupFactory.java b/base/src/org/compiere/model/MLookupFactory.java index 6dc11acb5a..04efa5c58b 100644 --- a/base/src/org/compiere/model/MLookupFactory.java +++ b/base/src/org/compiere/model/MLookupFactory.java @@ -411,11 +411,11 @@ public class MLookupFactory if (KeyColumn.endsWith("_ID")) realSQL.append("NULL,"); if (isValueDisplayed) - realSQL.append(TableName).append(".Value || '-' || "); + realSQL.append("NVL(").append(TableName).append(".Value,'-1') || '-' || "); if (displayColumnSQL != null && displayColumnSQL.trim().length() > 0) - realSQL.append(displayColumnSQL); + realSQL.append("NVL(").append(displayColumnSQL).append(",'-1')"); else - realSQL.append(TableName).append("_Trl.").append(DisplayColumn); + realSQL.append("NVL(").append(TableName).append("_Trl.").append(DisplayColumn).append(",'-1')"); realSQL.append(",").append(TableName).append(".IsActive"); realSQL.append(" FROM ").append(TableName) .append(" INNER JOIN ").append(TableName).append("_TRL ON (") @@ -431,11 +431,11 @@ public class MLookupFactory if (KeyColumn.endsWith("_ID")) realSQL.append("NULL,"); if (isValueDisplayed) - realSQL.append(TableName).append(".Value || '-' || "); + realSQL.append("NVL(").append(TableName).append(".Value,'-1') || '-' || "); if (displayColumnSQL != null && displayColumnSQL.trim().length() > 0) - realSQL.append(displayColumnSQL); + realSQL.append("NVL(").append(displayColumnSQL).append(",'-1')"); else - realSQL.append(TableName).append(".").append(DisplayColumn); + realSQL.append("NVL(").append(TableName).append(".").append(DisplayColumn).append(",'-1')"); realSQL.append(",").append(TableName).append(".IsActive"); realSQL.append(" FROM ").append(TableName); } @@ -668,6 +668,8 @@ public class MLookupFactory displayColumn.append(" ||'_'|| " ); LookupDisplayColumn ldc = (LookupDisplayColumn)list.get(i); + displayColumn.append("NVL("); + // translated if (ldc.IsTranslated && !Env.isBaseLanguage(language, TableName)) displayColumn.append(TableName).append("_Trl.").append(ldc.ColumnName); @@ -699,6 +701,9 @@ public class MLookupFactory // String else displayColumn.append(TableName).append(".").append(ldc.ColumnName); + + displayColumn.append(",'-1')"); + } realSQL.append(displayColumn.toString()); realSQL.append(",").append(TableName).append(".IsActive");