From cdabca7b4b3389d2f2913c8150ab772e41a9e302 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Tue, 5 Mar 2013 14:07:17 -0500 Subject: [PATCH] Minor changes to SQL - to ease the peer review of generated migration scripts avoiding convert changes --- .../src/org/compiere/model/M_Element.java | 4 ++-- .../src/org/compiere/print/MPrintFormatItem.java | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/org.adempiere.base/src/org/compiere/model/M_Element.java b/org.adempiere.base/src/org/compiere/model/M_Element.java index d60d53671d..c1f53048a7 100644 --- a/org.adempiere.base/src/org/compiere/model/M_Element.java +++ b/org.adempiere.base/src/org/compiere/model/M_Element.java @@ -287,12 +287,12 @@ public class M_Element extends X_AD_Element || is_ValueChanged(M_Element.COLUMNNAME_Name) ) { // Print Info - sql = new StringBuilder("UPDATE AD_PrintFormatItem pi SET PrintName=") + sql = new StringBuilder("UPDATE AD_PrintFormatItem SET PrintName=") .append(DB.TO_STRING(getPrintName())) .append(", Name=").append(DB.TO_STRING(getName())) .append(" WHERE IsCentrallyMaintained='Y'") .append(" AND EXISTS (SELECT * FROM AD_Column c ") - .append("WHERE c.AD_Column_ID=pi.AD_Column_ID AND c.AD_Element_ID=") + .append("WHERE c.AD_Column_ID=AD_PrintFormatItem.AD_Column_ID AND c.AD_Element_ID=") .append(get_ID()).append(")"); no = DB.executeUpdate(sql.toString(), get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine("PrintFormatItem updated #" + no); diff --git a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java index 5e4897bf0b..edc3ba7793 100644 --- a/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java +++ b/org.adempiere.base/src/org/compiere/print/MPrintFormatItem.java @@ -665,21 +665,21 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem // && MClient.get(getCtx()).isMultiLingualDocument() && getPrintName() != null && getPrintName().length() > 0) { - String sql = "UPDATE AD_PrintFormatItem_Trl trl " + String sql = "UPDATE AD_PrintFormatItem_Trl " + "SET PrintName = (SELECT e.PrintName " + "FROM AD_Element_Trl e, AD_Column c " - + "WHERE e.AD_Language=trl.AD_Language" + + "WHERE e.AD_Language=AD_PrintFormatItem_Trl.AD_Language" + " AND e.AD_Element_ID=c.AD_Element_ID" + " AND c.AD_Column_ID=" + getAD_Column_ID() + ") " + "WHERE AD_PrintFormatItem_ID = " + get_ID() + " AND EXISTS (SELECT * " + "FROM AD_Element_Trl e, AD_Column c " - + "WHERE e.AD_Language=trl.AD_Language" + + "WHERE e.AD_Language=AD_PrintFormatItem_Trl.AD_Language" + " AND e.AD_Element_ID=c.AD_Element_ID" + " AND c.AD_Column_ID=" + getAD_Column_ID() - + " AND trl.AD_PrintFormatItem_ID = " + get_ID() + ")" + + " AND AD_PrintFormatItem_Trl.AD_PrintFormatItem_ID = " + get_ID() + ")" + " AND EXISTS (SELECT * FROM AD_Client " - + "WHERE AD_Client_ID=trl.AD_Client_ID AND IsMultiLingualDocument='Y')"; + + "WHERE AD_Client_ID=AD_PrintFormatItem_Trl.AD_Client_ID AND IsMultiLingualDocument='Y')"; int no = DB.executeUpdate(sql, get_TrxName()); if (log.isLoggable(Level.FINE)) log.fine("translations updated #" + no); }