Fix [ 1955264 ] Changing columns is updating fields needlessly

This commit is contained in:
Carlos Ruiz 2008-05-01 05:41:20 +00:00
parent d0036eff0e
commit 0165e4d540
1 changed files with 13 additions and 8 deletions

View File

@ -256,14 +256,19 @@ public class MColumn extends X_AD_Column
// Update Fields
if (!newRecord)
{
StringBuffer sql = new StringBuffer("UPDATE AD_Field SET Name=")
.append(DB.TO_STRING(getName()))
.append(", Description=").append(DB.TO_STRING(getDescription()))
.append(", Help=").append(DB.TO_STRING(getHelp()))
.append(" WHERE AD_Column_ID=").append(get_ID())
.append(" AND IsCentrallyMaintained='Y'");
int no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("afterSave - Fields updated #" + no);
if ( is_ValueChanged(MColumn.COLUMNNAME_Name)
|| is_ValueChanged(MColumn.COLUMNNAME_Description)
|| is_ValueChanged(MColumn.COLUMNNAME_Help)
) {
StringBuffer sql = new StringBuffer("UPDATE AD_Field SET Name=")
.append(DB.TO_STRING(getName()))
.append(", Description=").append(DB.TO_STRING(getDescription()))
.append(", Help=").append(DB.TO_STRING(getHelp()))
.append(" WHERE AD_Column_ID=").append(get_ID())
.append(" AND IsCentrallyMaintained='Y'");
int no = DB.executeUpdate(sql.toString(), get_TrxName());
log.fine("afterSave - Fields updated #" + no);
}
}
return success;
} // afterSave