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
This commit is contained in:
Carlos Ruiz 2010-03-03 23:04:46 +00:00
parent 98c74ef980
commit 1a06e21024
7 changed files with 16 additions and 22 deletions

View File

@ -77,9 +77,8 @@ public class MDocType extends X_C_DocType
*/
static public MDocType[] getOfClient (Properties ctx)
{
final String whereClause = "AD_Client_ID=?";
List<MDocType> list = new Query(ctx, Table_Name, whereClause, null)
.setParameters(Env.getAD_Client_ID(ctx))
List<MDocType> list = new Query(ctx, Table_Name, null, null)
.setClient_ID()
.setOnlyActiveRecords(true)
.list();
return list.toArray(new MDocType[list.size()]);

View File

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

View File

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

View File

@ -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<MInventoryLine> list = new Query(getCtx(), MInventoryLine.Table_Name, "M_Inventory_ID=?", get_TrxName())
List<MInventoryLine> list = new Query(getCtx(), I_M_InventoryLine.Table_Name, "M_Inventory_ID=?", get_TrxName())
.setParameters(get_ID())
.setOrderBy(MInventoryLine.COLUMNNAME_Line)
.list();

View File

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

View File

@ -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 <MJournalLine> list = new Query(getCtx(), I_GL_JournalLine.Table_Name, whereClause.toString(), null)
List <MJournalLine> list = new Query(getCtx(), I_GL_JournalLine.Table_Name, whereClause, null)
.setParameters(getGL_Journal_ID())
.setOrderBy("Line")
.list();

View File

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