Minor changes to SQL - to ease the peer review of generated migration scripts avoiding convert changes
This commit is contained in:
parent
7be4abcace
commit
cdabca7b4b
|
@ -287,12 +287,12 @@ public class M_Element extends X_AD_Element
|
||||||
|| is_ValueChanged(M_Element.COLUMNNAME_Name)
|
|| is_ValueChanged(M_Element.COLUMNNAME_Name)
|
||||||
) {
|
) {
|
||||||
// Print Info
|
// 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(DB.TO_STRING(getPrintName()))
|
||||||
.append(", Name=").append(DB.TO_STRING(getName()))
|
.append(", Name=").append(DB.TO_STRING(getName()))
|
||||||
.append(" WHERE IsCentrallyMaintained='Y'")
|
.append(" WHERE IsCentrallyMaintained='Y'")
|
||||||
.append(" AND EXISTS (SELECT * FROM AD_Column c ")
|
.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(")");
|
.append(get_ID()).append(")");
|
||||||
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
no = DB.executeUpdate(sql.toString(), get_TrxName());
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("PrintFormatItem updated #" + no);
|
if (log.isLoggable(Level.FINE)) log.fine("PrintFormatItem updated #" + no);
|
||||||
|
|
|
@ -665,21 +665,21 @@ public class MPrintFormatItem extends X_AD_PrintFormatItem
|
||||||
// && MClient.get(getCtx()).isMultiLingualDocument()
|
// && MClient.get(getCtx()).isMultiLingualDocument()
|
||||||
&& getPrintName() != null && getPrintName().length() > 0)
|
&& getPrintName() != null && getPrintName().length() > 0)
|
||||||
{
|
{
|
||||||
String sql = "UPDATE AD_PrintFormatItem_Trl trl "
|
String sql = "UPDATE AD_PrintFormatItem_Trl "
|
||||||
+ "SET PrintName = (SELECT e.PrintName "
|
+ "SET PrintName = (SELECT e.PrintName "
|
||||||
+ "FROM AD_Element_Trl e, AD_Column c "
|
+ "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 e.AD_Element_ID=c.AD_Element_ID"
|
||||||
+ " AND c.AD_Column_ID=" + getAD_Column_ID() + ") "
|
+ " AND c.AD_Column_ID=" + getAD_Column_ID() + ") "
|
||||||
+ "WHERE AD_PrintFormatItem_ID = " + get_ID()
|
+ "WHERE AD_PrintFormatItem_ID = " + get_ID()
|
||||||
+ " AND EXISTS (SELECT * "
|
+ " AND EXISTS (SELECT * "
|
||||||
+ "FROM AD_Element_Trl e, AD_Column c "
|
+ "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 e.AD_Element_ID=c.AD_Element_ID"
|
||||||
+ " AND c.AD_Column_ID=" + getAD_Column_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 "
|
+ " 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());
|
int no = DB.executeUpdate(sql, get_TrxName());
|
||||||
if (log.isLoggable(Level.FINE)) log.fine("translations updated #" + no);
|
if (log.isLoggable(Level.FINE)) log.fine("translations updated #" + no);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue