Minor changes to SQL - to ease the peer review of generated migration scripts avoiding convert changes

This commit is contained in:
Carlos Ruiz 2013-03-05 14:07:17 -05:00
parent 7be4abcace
commit cdabca7b4b
2 changed files with 7 additions and 7 deletions

View File

@ -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);

View File

@ -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);
}