From 1a06e210241c45a4e806b11d800bc8f3f2e033e5 Mon Sep 17 00:00:00 2001 From: Carlos Ruiz Date: Wed, 3 Mar 2010 23:04:46 +0000 Subject: [PATCH] peer review for 11547 - minor changes FR: [ 2214883 ] Remove SQL code and Replace for Query Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2214883 --- base/src/org/compiere/model/MDocType.java | 5 ++--- base/src/org/compiere/model/MEXPFormat.java | 16 ++++++++-------- .../src/org/compiere/model/MFreightCategory.java | 6 ++---- base/src/org/compiere/model/MInventory.java | 5 ++--- base/src/org/compiere/model/MInventoryLine.java | 3 +-- base/src/org/compiere/model/MJournal.java | 2 +- base/src/org/compiere/model/MLanguage.java | 1 - 7 files changed, 16 insertions(+), 22 deletions(-) diff --git a/base/src/org/compiere/model/MDocType.java b/base/src/org/compiere/model/MDocType.java index 4dccd1de18..927700fb48 100644 --- a/base/src/org/compiere/model/MDocType.java +++ b/base/src/org/compiere/model/MDocType.java @@ -77,9 +77,8 @@ public class MDocType extends X_C_DocType */ static public MDocType[] getOfClient (Properties ctx) { - final String whereClause = "AD_Client_ID=?"; - List list = new Query(ctx, Table_Name, whereClause, null) - .setParameters(Env.getAD_Client_ID(ctx)) + List list = new Query(ctx, Table_Name, null, null) + .setClient_ID() .setOnlyActiveRecords(true) .list(); return list.toArray(new MDocType[list.size()]); diff --git a/base/src/org/compiere/model/MEXPFormat.java b/base/src/org/compiere/model/MEXPFormat.java index eec9a8bdf3..02d38c7960 100644 --- a/base/src/org/compiere/model/MEXPFormat.java +++ b/base/src/org/compiere/model/MEXPFormat.java @@ -130,18 +130,18 @@ public class MEXPFormat extends X_EXP_Format { if(retValue!=null) return retValue; - StringBuffer whereCluse = new StringBuffer(X_EXP_Format.COLUMNNAME_Value).append("=?") + StringBuffer whereClause = new StringBuffer(X_EXP_Format.COLUMNNAME_Value).append("=?") .append(" AND AD_Client_ID = ?") .append(" AND ").append(X_EXP_Format.COLUMNNAME_Version).append(" = ?"); - retValue = (MEXPFormat) new Query(ctx,X_EXP_Format.Table_Name,whereCluse.toString(),trxName) + retValue = (MEXPFormat) new Query(ctx,X_EXP_Format.Table_Name,whereClause.toString(),trxName) .setParameters(value,AD_Client_ID,version).first(); if(retValue != null) { - retValue.getFormatLines(); - s_cache.put (key, retValue); - exp_format_by_id_cache.put(retValue.getEXP_Format_ID(), retValue); + retValue.getFormatLines(); + s_cache.put (key, retValue); + exp_format_by_id_cache.put(retValue.getEXP_Format_ID(), retValue); } return retValue; @@ -165,9 +165,9 @@ public class MEXPFormat extends X_EXP_Format { .first(); if(retValue!=null) { - retValue.getFormatLines(); - s_cache.put (key, retValue); - exp_format_by_id_cache.put(retValue.getEXP_Format_ID(), retValue); + retValue.getFormatLines(); + s_cache.put (key, retValue); + exp_format_by_id_cache.put(retValue.getEXP_Format_ID(), retValue); } return retValue; diff --git a/base/src/org/compiere/model/MFreightCategory.java b/base/src/org/compiere/model/MFreightCategory.java index 3a8fe57947..fc48cd6de4 100644 --- a/base/src/org/compiere/model/MFreightCategory.java +++ b/base/src/org/compiere/model/MFreightCategory.java @@ -32,8 +32,6 @@ package org.compiere.model; import java.sql.ResultSet; import java.util.Properties; - -import org.compiere.util.Env; /** * * @author Daniel Tamm @@ -80,8 +78,8 @@ public class MFreightCategory extends X_M_FreightCategory { */ public static MFreightCategory getByValue(Properties ctx, String value, String trxName) { - Query q = new Query(ctx, I_M_FreightCategory.Table_Name, "Value=? AND AD_Client_ID=?", trxName); - q.setParameters(value, Env.getAD_Client_ID(ctx)); + Query q = new Query(ctx, I_M_FreightCategory.Table_Name, "Value=?", trxName); + q.setParameters(value).setClient_ID(); return q.first(); } diff --git a/base/src/org/compiere/model/MInventory.java b/base/src/org/compiere/model/MInventory.java index abe3cd21c5..5ca61f46c5 100644 --- a/base/src/org/compiere/model/MInventory.java +++ b/base/src/org/compiere/model/MInventory.java @@ -48,8 +48,7 @@ public class MInventory extends X_M_Inventory implements DocAction /** * */ - private static final long serialVersionUID = 910998472569265447L; - + private static final long serialVersionUID = -7137974064086172763L; /** * Get Inventory from Cache @@ -145,7 +144,7 @@ public class MInventory extends X_M_Inventory implements DocAction return m_lines; } // - List list = new Query(getCtx(), MInventoryLine.Table_Name, "M_Inventory_ID=?", get_TrxName()) + List list = new Query(getCtx(), I_M_InventoryLine.Table_Name, "M_Inventory_ID=?", get_TrxName()) .setParameters(get_ID()) .setOrderBy(MInventoryLine.COLUMNNAME_Line) .list(); diff --git a/base/src/org/compiere/model/MInventoryLine.java b/base/src/org/compiere/model/MInventoryLine.java index a074e86cdf..057ee893dc 100644 --- a/base/src/org/compiere/model/MInventoryLine.java +++ b/base/src/org/compiere/model/MInventoryLine.java @@ -39,8 +39,7 @@ public class MInventoryLine extends X_M_InventoryLine /** * */ - private static final long serialVersionUID = 1336000922103246463L; - + private static final long serialVersionUID = 5649152656460089476L; /** * Get Inventory Line with parameters diff --git a/base/src/org/compiere/model/MJournal.java b/base/src/org/compiere/model/MJournal.java index 17556987f6..55d52c0e34 100644 --- a/base/src/org/compiere/model/MJournal.java +++ b/base/src/org/compiere/model/MJournal.java @@ -216,7 +216,7 @@ public class MJournal extends X_GL_Journal implements DocAction { //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 final String whereClause = "GL_Journal_ID=?"; - List list = new Query(getCtx(), I_GL_JournalLine.Table_Name, whereClause.toString(), null) + List list = new Query(getCtx(), I_GL_JournalLine.Table_Name, whereClause, null) .setParameters(getGL_Journal_ID()) .setOrderBy("Line") .list(); diff --git a/base/src/org/compiere/model/MLanguage.java b/base/src/org/compiere/model/MLanguage.java index 466743097b..9ed15c0d5f 100644 --- a/base/src/org/compiere/model/MLanguage.java +++ b/base/src/org/compiere/model/MLanguage.java @@ -138,7 +138,6 @@ public class MLanguage extends X_AD_Language * @param LanguageISO language code * @param trxName transaction */ - @SuppressWarnings("unused") private MLanguage (Properties ctx, String AD_Language, String Name, String CountryCode, String LanguageISO, String trxName) {