Fix a NPE problem found with [2877111] - See identifiers columns when delete records

https://sourceforge.net/tracker/?func=detail&atid=879335&aid=2877111&group_id=176962
This commit is contained in:
Carlos Ruiz 2009-11-23 23:30:19 +00:00
parent 58247852cd
commit 49abb6fb04
1 changed files with 4 additions and 4 deletions

View File

@ -848,24 +848,24 @@ public class MLookupFactory
// date, number // date, number
else if (DisplayType.isDate(ldc.DisplayType) || DisplayType.isNumeric(ldc.DisplayType)) else if (DisplayType.isDate(ldc.DisplayType) || DisplayType.isNumeric(ldc.DisplayType))
{ {
embedSQL.append(DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language())); embedSQL.append("COALESCE(" + DB.TO_CHAR(TableName + "." + ldc.ColumnName, ldc.DisplayType, language.getAD_Language()) + ",'')");
} }
// TableDir // TableDir
else if ((ldc.DisplayType == DisplayType.TableDir || ldc.DisplayType == DisplayType.Search) else if ((ldc.DisplayType == DisplayType.TableDir || ldc.DisplayType == DisplayType.Search)
&& ldc.ColumnName.endsWith("_ID")) && ldc.ColumnName.endsWith("_ID"))
{ {
String embeddedSQL = getLookup_TableDirEmbed(language, ldc.ColumnName, TableName); String embeddedSQL = getLookup_TableDirEmbed(language, ldc.ColumnName, TableName);
embedSQL.append("(").append(embeddedSQL).append(")"); embedSQL.append("COALESCE((").append(embeddedSQL).append("),'')");
} }
// Table - teo_sarca [ 1714261 ] // Table - teo_sarca [ 1714261 ]
else if (ldc.DisplayType == DisplayType.Table && ldc.AD_Reference_ID != 0) else if (ldc.DisplayType == DisplayType.Table && ldc.AD_Reference_ID != 0)
{ {
String embeddedSQL = getLookup_TableEmbed (language, ldc.ColumnName, TableName, ldc.AD_Reference_ID); String embeddedSQL = getLookup_TableEmbed (language, ldc.ColumnName, TableName, ldc.AD_Reference_ID);
embedSQL.append("(").append(embeddedSQL).append(")"); embedSQL.append("COALESCE((").append(embeddedSQL).append("),'')");
} }
// String // String
else else
embedSQL.append(TableName).append(".").append(ldc.ColumnName); embedSQL.append("COALESCE(").append(TableName).append(".").append(ldc.ColumnName).append(",'')");
} }
embedSQL.append(" FROM ").append(TableName); embedSQL.append(" FROM ").append(TableName);