peer review for 11533, 11537, 11540

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 21:43:37 +00:00
parent d9b22ee7ed
commit e7177049db
7 changed files with 34 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/**********************************************************************
/***********************************************************************
* This file is part of Adempiere ERP Bazaar *
* http://www.adempiere.org *
* *
@ -23,16 +23,32 @@
* Sponsors: *
* - Company (http://www.notima.se) *
* - Company (http://www.cyberphoto.se) *
***********************************************************************/
**********************************************************************/
package org.adempiere.process;
import java.math.BigDecimal;
import java.util.*;
import java.util.logging.*;
import org.compiere.model.*;
import org.compiere.process.*;
import org.compiere.util.*;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.TreeMap;
import java.util.logging.Level;
import org.compiere.model.I_C_ElementValue;
import org.compiere.model.I_C_ValidCombination;
import org.compiere.model.I_M_Product;
import org.compiere.model.I_M_Product_Acct;
import org.compiere.model.MAccount;
import org.compiere.model.MElementValue;
import org.compiere.model.MPriceList;
import org.compiere.model.MPriceListVersion;
import org.compiere.model.MProduct;
import org.compiere.model.MProductPrice;
import org.compiere.model.Query;
import org.compiere.model.X_M_Product_Acct;
import org.compiere.process.ProcessInfoParameter;
import org.compiere.process.SvrProcess;
import org.compiere.util.Env;
/**
* Creates expense type products from a given range of expense account

View File

@ -217,7 +217,7 @@ public class MCash extends X_C_Cash implements DocAction
return m_lines;
}
final String whereClause =MCashLine.COLUMNNAME_C_Cash_ID+"=?";
final String whereClause =MCashLine.COLUMNNAME_C_Cash_ID+"=?";
List<MCashLine> list = new Query(getCtx(),I_C_CashLine.Table_Name, whereClause, get_TrxName())
.setParameters(getC_Cash_ID())
.setOrderBy(I_C_CashLine.COLUMNNAME_Line)

View File

@ -32,9 +32,11 @@ import org.compiere.util.DB;
*/
public class MContainer extends X_CM_Container
{
/** serialVersionUID */
private static final long serialVersionUID = 395679572291279730L;
/**
*
*/
private static final long serialVersionUID = 3999588662066631303L;
/**
* get Container by Relative URL
* @param ctx

View File

@ -46,7 +46,8 @@ public class MConversionRate extends X_C_Conversion_Rate
/**
*
*/
private static final long serialVersionUID = -2753651400799848008L;
private static final long serialVersionUID = -8171829790483133141L;
/** Logger */
private static CLogger s_log = CLogger.getCLogger (MConversionRate.class);

View File

@ -105,7 +105,7 @@ public class MCurrency extends X_C_Currency
return retValue;
// Try database
Query query = new Query(ctx, I_C_Currency.Table_Name, "iso_code=?", null);
Query query = new Query(ctx, I_C_Currency.Table_Name, "ISO_Code=?", null);
query.setParameters(ISOcode);
retValue = (MCurrency)query.firstOnly();

View File

@ -17,14 +17,10 @@
package org.compiere.model;
import java.math.BigDecimal;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.util.List;
import java.util.Properties;
import java.util.logging.Level;
import org.compiere.util.CLogger;
import org.compiere.util.DB;
import org.compiere.util.Env;
/**
@ -35,7 +31,6 @@ import org.compiere.util.Env;
*/
public class MProductPrice extends X_M_ProductPrice
{
/**
*
*/

View File

@ -66,7 +66,7 @@ public class MDDOrder extends X_DD_Order implements DocAction
/**
*
*/
private static final long serialVersionUID = -2407222565384020843L;
private static final long serialVersionUID = -5997157712614274458L;
/**
* Create new Order by copying
@ -433,7 +433,7 @@ public class MDDOrder extends X_DD_Order implements DocAction
{
StringBuffer whereClauseFinal = new StringBuffer(MDDOrderLine.COLUMNNAME_DD_Order_ID).append("=?");
if (!Util.isEmpty(whereClause, true))
whereClauseFinal.append("AND (").append(whereClause).append(")");
whereClauseFinal.append(" AND (").append(whereClause).append(")");
//
List<MDDOrderLine> list = new Query(getCtx(), I_DD_OrderLine.Table_Name, whereClauseFinal.toString(), get_TrxName())
.setParameters(getDD_Order_ID())