diff --git a/base/src/org/compiere/model/MRMA.java b/base/src/org/compiere/model/MRMA.java index 4f553f713b..986c1730a5 100644 --- a/base/src/org/compiere/model/MRMA.java +++ b/base/src/org/compiere/model/MRMA.java @@ -95,8 +95,8 @@ public class MRMA extends X_M_RMA implements DocAction set_TrxName(m_lines, get_TrxName()); return m_lines; } - List list = new Query(getCtx(), MRMALine.Table_Name, "M_RMA_ID=?", get_TrxName()) - .setParameters(new Object[]{getM_RMA_ID()}) + List list = new Query(getCtx(), I_M_RMALine.Table_Name, "M_RMA_ID=?", get_TrxName()) + .setParameters(getM_RMA_ID()) .setOrderBy(MRMALine.COLUMNNAME_Line) .list(); diff --git a/base/src/org/compiere/model/MRMALine.java b/base/src/org/compiere/model/MRMALine.java index fb50495aed..f763b8cdf0 100644 --- a/base/src/org/compiere/model/MRMALine.java +++ b/base/src/org/compiere/model/MRMALine.java @@ -168,8 +168,8 @@ public class MRMALine extends X_M_RMALine */ private int getInvoiceLineId() { - int invoiceLine_ID = new Query(getCtx(), MInvoiceLine.Table_Name, "M_InOutLine_ID=?", get_TrxName()) - .setParameters(new Object[]{getM_InOutLine_ID()}) + int invoiceLine_ID = new Query(getCtx(), I_C_InvoiceLine.Table_Name, "M_InOutLine_ID=?", get_TrxName()) + .setParameters(getM_InOutLine_ID()) .firstIdOnly(); return invoiceLine_ID <= 0 ? 0 : invoiceLine_ID; } diff --git a/base/src/org/compiere/model/MRefList.java b/base/src/org/compiere/model/MRefList.java index d7e9f0e9bf..5ad9de57b8 100644 --- a/base/src/org/compiere/model/MRefList.java +++ b/base/src/org/compiere/model/MRefList.java @@ -58,7 +58,7 @@ public class MRefList extends X_AD_Ref_List public static MRefList get (Properties ctx, int AD_Reference_ID, String Value, String trxName) { return new Query(ctx, Table_Name, "AD_Reference_ID=? AND Value=?", trxName) - .setParameters(new Object[]{AD_Reference_ID, Value}) + .setParameters(AD_Reference_ID, Value) .firstOnly(); } // get diff --git a/base/src/org/compiere/model/MReplenish.java b/base/src/org/compiere/model/MReplenish.java index eee90d9b4d..72fad56c84 100644 --- a/base/src/org/compiere/model/MReplenish.java +++ b/base/src/org/compiere/model/MReplenish.java @@ -78,9 +78,9 @@ public class MReplenish extends X_M_Replenish { * @return A list of active replenish lines for given product. */ public static List getForProduct(Properties ctx, int M_ProductID, String trxName) { - String whereClause= "M_Product_ID=? AND AD_Client_ID=? AND AD_Org_ID IN (0, ?) "; - return new Query(ctx, MReplenish.Table_Name, whereClause, trxName) - .setParameters(new Object[]{M_ProductID, Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx)}) + final String whereClause= "M_Product_ID=? AND AD_Client_ID=? AND AD_Org_ID IN (0, ?) "; + return new Query(ctx, I_M_Replenish.Table_Name, whereClause, trxName) + .setParameters(M_ProductID, Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx)) .setOrderBy("AD_Org_ID") .setOnlyActiveRecords(true) .list(); diff --git a/base/src/org/compiere/model/MReplicationStrategy.java b/base/src/org/compiere/model/MReplicationStrategy.java index e841a184e7..cb6c4db1b2 100644 --- a/base/src/org/compiere/model/MReplicationStrategy.java +++ b/base/src/org/compiere/model/MReplicationStrategy.java @@ -57,10 +57,10 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { * @return the collection the X_AD_ReplicationTable */ public Collection getReplicationTables() { - String whereClause = new StringBuffer(X_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID)+"=?"; // #1 + final String whereClause = new StringBuffer(X_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID)+"=?"; // #1 return new Query(getCtx(), X_AD_ReplicationTable.Table_Name, whereClause, get_TrxName()) .setClient_ID() - .setParameters(new Object[]{getAD_ReplicationStrategy_ID()}) + .setParameters(getAD_ReplicationStrategy_ID()) .setOnlyActiveRecords(true) .setApplyAccessFilter(false) .list() @@ -74,7 +74,7 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { String whereClause = "AD_ReplicationStrategy_ID=?"; // #1 return new Query(getCtx(),X_AD_ReplicationDocument.Table_Name,whereClause,get_TrxName()) .setClient_ID() - .setParameters(new Object[]{getAD_ReplicationStrategy_ID()}) + .setParameters(getAD_ReplicationStrategy_ID()) .setOnlyActiveRecords(true) .setApplyAccessFilter(false) .list() @@ -88,12 +88,12 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { */ public static X_AD_ReplicationTable getReplicationTable(Properties ctx ,int AD_ReplicationStrategy_ID, int AD_Table_ID) { - String whereClause = "AD_ReplicationStrategy_ID=? AND AD_Table_ID=?"; + final String whereClause = "AD_ReplicationStrategy_ID=? AND AD_Table_ID=?"; return new Query(ctx, X_AD_ReplicationTable.Table_Name, whereClause, null) .setClient_ID() .setOnlyActiveRecords(true) .setApplyAccessFilter(false) - .setParameters(new Object[]{AD_ReplicationStrategy_ID, AD_Table_ID}) + .setParameters(AD_ReplicationStrategy_ID, AD_Table_ID) .first() ; } @@ -110,7 +110,7 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { .setClient_ID() .setOnlyActiveRecords(true) .setApplyAccessFilter(false) - .setParameters(new Object[]{AD_ReplicationStrategy_ID, AD_Table_ID}) + .setParameters(AD_ReplicationStrategy_ID, AD_Table_ID) .first() ; } @@ -127,7 +127,7 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy { .setClient_ID() .setOnlyActiveRecords(true) .setApplyAccessFilter(false) - .setParameters(new Object[]{AD_ReplicationStrategy_ID, AD_Table_ID, C_DocType_ID}) + .setParameters(AD_ReplicationStrategy_ID, AD_Table_ID, C_DocType_ID) .first(); } diff --git a/base/src/org/compiere/model/MRequest.java b/base/src/org/compiere/model/MRequest.java index 0543ef33bc..40434e6810 100644 --- a/base/src/org/compiere/model/MRequest.java +++ b/base/src/org/compiere/model/MRequest.java @@ -237,8 +237,8 @@ public class MRequest extends X_R_Request public MRequestAction[] getActions() { final String whereClause = MRequestAction.COLUMNNAME_R_Request_ID+"=?"; - List list = new Query(getCtx(), MRequestAction.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{get_ID()}) + List list = new Query(getCtx(), I_R_RequestAction.Table_Name, whereClause, get_TrxName()) + .setParameters(get_ID()) .setOrderBy("Created DESC") .list(); return list.toArray(new MRequestAction[list.size()]); @@ -252,8 +252,8 @@ public class MRequest extends X_R_Request public MRequestUpdate[] getUpdates(String confidentialType) { final String whereClause = MRequestUpdate.COLUMNNAME_R_Request_ID+"=?"; - List listUpdates = new Query(getCtx(), MRequestUpdate.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{get_ID()}) + List listUpdates = new Query(getCtx(), I_R_RequestUpdate.Table_Name, whereClause, get_TrxName()) + .setParameters(get_ID()) .setOrderBy("Created DESC") .list(); ArrayList list = new ArrayList(); diff --git a/base/src/org/compiere/model/MRequisition.java b/base/src/org/compiere/model/MRequisition.java index 2d64f5f48a..c7b032918b 100644 --- a/base/src/org/compiere/model/MRequisition.java +++ b/base/src/org/compiere/model/MRequisition.java @@ -102,10 +102,10 @@ public class MRequisition extends X_M_Requisition implements DocAction } //red1 - FR: [ 2214883 ] Remove SQL code and Replace for Query - String whereClause = MRequisitionLine.COLUMNNAME_M_Requisition_ID+"=?"; - List list = new Query(getCtx(), MRequisitionLine.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{get_ID()}) - .setOrderBy(MRequisitionLine.COLUMNNAME_Line) + String whereClause = I_M_RequisitionLine.COLUMNNAME_M_Requisition_ID+"=?"; + List list = new Query(getCtx(), I_M_RequisitionLine.Table_Name, whereClause, get_TrxName()) + .setParameters(get_ID()) + .setOrderBy(I_M_RequisitionLine.COLUMNNAME_Line) .list(); // red1 - end - diff --git a/base/src/org/compiere/model/MRequisitionLine.java b/base/src/org/compiere/model/MRequisitionLine.java index 26aeadb974..17612b7245 100644 --- a/base/src/org/compiere/model/MRequisitionLine.java +++ b/base/src/org/compiere/model/MRequisitionLine.java @@ -59,8 +59,8 @@ public class MRequisitionLine extends X_M_RequisitionLine final String whereClause = "EXISTS (SELECT 1 FROM C_OrderLine ol" +" WHERE ol.C_OrderLine_ID=M_RequisitionLine.C_OrderLine_ID" +" AND ol.C_Order_ID=?)"; - List list = new Query(ctx, MRequisitionLine.Table_Name, whereClause, trxName) - .setParameters(new Object[]{C_Order_ID}) + List list = new Query(ctx, I_M_RequisitionLine.Table_Name, whereClause, trxName) + .setParameters(C_Order_ID) .list(); return list.toArray(new MRequisitionLine[list.size()]); } @@ -91,8 +91,8 @@ public class MRequisitionLine extends X_M_RequisitionLine public static MRequisitionLine[] forC_OrderLine_ID(Properties ctx, int C_OrderLine_ID, String trxName) { final String whereClause = COLUMNNAME_C_OrderLine_ID+"=?"; - List list = new Query(ctx, MRequisitionLine.Table_Name, whereClause, trxName) - .setParameters(new Object[]{C_OrderLine_ID}) + List list = new Query(ctx, I_M_RequisitionLine.Table_Name, whereClause, trxName) + .setParameters(C_OrderLine_ID) .list(); return list.toArray(new MRequisitionLine[list.size()]); } diff --git a/base/src/org/compiere/model/MResourceUnAvailable.java b/base/src/org/compiere/model/MResourceUnAvailable.java index b9b44b3704..255bc6fc59 100644 --- a/base/src/org/compiere/model/MResourceUnAvailable.java +++ b/base/src/org/compiere/model/MResourceUnAvailable.java @@ -54,8 +54,8 @@ public class MResourceUnAvailable extends X_S_ResourceUnAvailable +" AND TRUNC("+COLUMNNAME_DateFrom+") <= ?" +" AND TRUNC("+COLUMNNAME_DateTo+") >= ?"; Properties ctx = r instanceof PO ? ((PO)r).getCtx() : Env.getCtx(); - return new Query(ctx, MResourceUnAvailable.Table_Name, whereClause, null) - .setParameters(new Object[]{r.getS_Resource_ID(), r.getAD_Client_ID(), date, date}) + return new Query(ctx, I_S_ResourceUnAvailable.Table_Name, whereClause, null) + .setParameters(r.getS_Resource_ID(), r.getAD_Client_ID(), date, date) .match(); } diff --git a/base/src/org/compiere/model/MScheduler.java b/base/src/org/compiere/model/MScheduler.java index 1998162097..005e7efd7c 100644 --- a/base/src/org/compiere/model/MScheduler.java +++ b/base/src/org/compiere/model/MScheduler.java @@ -124,8 +124,8 @@ public class MScheduler extends X_AD_Scheduler public AdempiereProcessorLog[] getLogs () { final String whereClause = MSchedulerLog.COLUMNNAME_AD_Scheduler_ID+"=?"; - List list = new Query(getCtx(), MSchedulerLog.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{getAD_Scheduler_ID()}) + List list = new Query(getCtx(), I_AD_SchedulerLog.Table_Name, whereClause, get_TrxName()) + .setParameters(getAD_Scheduler_ID()) .setOrderBy("Created DESC") .list(); MSchedulerLog[] retValue = new MSchedulerLog[list.size ()]; @@ -168,8 +168,8 @@ public class MScheduler extends X_AD_Scheduler return m_parameter; // final String whereClause = MSchedulerPara.COLUMNNAME_AD_Scheduler_ID+"=?"; - List list = new Query(getCtx(), MSchedulerPara.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{getAD_Scheduler_ID()}) + List list = new Query(getCtx(), I_AD_Scheduler_Para.Table_Name, whereClause, get_TrxName()) + .setParameters(getAD_Scheduler_ID()) .setOnlyActiveRecords(true) .list(); m_parameter = new MSchedulerPara[list.size()]; @@ -188,8 +188,8 @@ public class MScheduler extends X_AD_Scheduler return m_recipients; // String whereClause = MSchedulerRecipient.COLUMNNAME_AD_Scheduler_ID+"=?"; - final List list = new Query(getCtx(), MSchedulerRecipient.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{getAD_Scheduler_ID()}) + final List list = new Query(getCtx(), I_AD_SchedulerRecipient.Table_Name, whereClause, get_TrxName()) + .setParameters(getAD_Scheduler_ID()) .setOnlyActiveRecords(true) .list(); m_recipients = new MSchedulerRecipient[list.size()]; diff --git a/base/src/org/compiere/model/MShipper.java b/base/src/org/compiere/model/MShipper.java index 3b48aef543..0937795fc6 100644 --- a/base/src/org/compiere/model/MShipper.java +++ b/base/src/org/compiere/model/MShipper.java @@ -67,10 +67,10 @@ public class MShipper extends X_M_Shipper * @return A list of shippers having the given freight category */ public static List getShippersForFreightCategory(Properties ctx, int FreightCategory_ID, String trxName) { - Query q = new Query(ctx, MShipper.Table_Name, + Query q = new Query(ctx, I_M_Shipper.Table_Name, "M_Shipper.AD_Client_ID=? AND M_Shipper.AD_Org_ID IN (0,?) AND M_Shipper_ID " + "IN (SELECT M_Shipper_ID FROM M_Freight WHERE M_FreightCategory_ID=?)", trxName); - q.setParameters(new Object[]{Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx), FreightCategory_ID}); + q.setParameters(Env.getAD_Client_ID(ctx), Env.getAD_Org_ID(ctx), FreightCategory_ID); List result = q.list(); return(result); } diff --git a/base/src/org/compiere/model/MTableScriptValidator.java b/base/src/org/compiere/model/MTableScriptValidator.java index 297e4586e5..b8f9634ebf 100644 --- a/base/src/org/compiere/model/MTableScriptValidator.java +++ b/base/src/org/compiere/model/MTableScriptValidator.java @@ -83,7 +83,7 @@ public class MTableScriptValidator extends X_AD_Table_ScriptValidator // Fetch now final String whereClause = "AD_Table_ID=? AND EventModelValidator=?"; mvrs = new Query(ctx, Table_Name, whereClause, null) - .setParameters(new Object[]{ad_table_id, event}) + .setParameters(ad_table_id, event) .setOnlyActiveRecords(true) .setOrderBy(COLUMNNAME_SeqNo) .list(); diff --git a/base/src/org/compiere/model/MTax.java b/base/src/org/compiere/model/MTax.java index 2510f2bab8..c438dec4ab 100644 --- a/base/src/org/compiere/model/MTax.java +++ b/base/src/org/compiere/model/MTax.java @@ -70,8 +70,8 @@ public class MTax extends X_C_Tax // Create it //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 String whereClause = "AD_Client_ID=?"; - List list = new Query(ctx, MTax.Table_Name, whereClause, null) - .setParameters(new Object[]{AD_Client_ID}) + List list = new Query(ctx, I_C_Tax.Table_Name, whereClause, null) + .setParameters(AD_Client_ID) .setOrderBy("C_Country_ID, C_Region_ID, To_Country_ID, To_Region_ID") .setOnlyActiveRecords(true) .list(); @@ -170,8 +170,8 @@ public class MTax extends X_C_Tax // //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 String whereClause = COLUMNNAME_Parent_Tax_ID+"=?"; - List list = new Query(getCtx(), MTax.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{getC_Tax_ID()}) + List list = new Query(getCtx(), I_C_Tax.Table_Name, whereClause, get_TrxName()) + .setParameters(getC_Tax_ID()) .setOnlyActiveRecords(true) .list(); //red1 - end - @@ -192,11 +192,11 @@ public class MTax extends X_C_Tax return m_postals; //FR: [ 2214883 ] Remove SQL code and Replace for Query - red1 - String whereClause = MTaxPostal.COLUMNNAME_C_Tax_ID+"=?"; - List list = new Query(getCtx(), MTaxPostal.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{getC_Tax_ID()}) + final String whereClause = MTaxPostal.COLUMNNAME_C_Tax_ID+"=?"; + List list = new Query(getCtx(), I_C_TaxPostal.Table_Name, whereClause, get_TrxName()) + .setParameters(getC_Tax_ID()) .setOnlyActiveRecords(true) - .setOrderBy(MTaxPostal.COLUMNNAME_Postal+", "+MTaxPostal.COLUMNNAME_Postal_To) + .setOrderBy(I_C_TaxPostal.COLUMNNAME_Postal+", "+I_C_TaxPostal.COLUMNNAME_Postal_To) .list(); //red1 - end - @@ -286,8 +286,8 @@ public class MTax extends X_C_Tax String whereClause = MTax.COLUMNNAME_C_TaxCategory_ID+"=? AND " + MTax.COLUMNNAME_C_Tax_ID+"<>? AND "+ "IsDefault='Y'"; - List list = new Query(getCtx(), MTax.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{getC_TaxCategory_ID(), getC_Tax_ID()}) + List list = new Query(getCtx(), I_C_Tax.Table_Name, whereClause, get_TrxName()) + .setParameters(getC_TaxCategory_ID(), getC_Tax_ID()) .setOnlyActiveRecords(true) .list(); if (list.size() >= 1) { diff --git a/base/src/org/compiere/model/MTaxCategory.java b/base/src/org/compiere/model/MTaxCategory.java index 5206fc42ed..8d4762b03f 100644 --- a/base/src/org/compiere/model/MTaxCategory.java +++ b/base/src/org/compiere/model/MTaxCategory.java @@ -72,8 +72,8 @@ public class MTaxCategory extends X_C_TaxCategory MTax m_tax = new MTax(getCtx(), 0, get_TrxName()); String whereClause = COLUMNNAME_C_TaxCategory_ID+"=? AND "+ COLUMNNAME_IsDefault+"='Y'"; - List list = new Query(getCtx(), MTax.Table_Name, whereClause, get_TrxName()) - .setParameters(new Object[]{getC_TaxCategory_ID()}) + List list = new Query(getCtx(), I_C_Tax.Table_Name, whereClause, get_TrxName()) + .setParameters(getC_TaxCategory_ID()) .setOnlyActiveRecords(true) .list(); if (list.size() == 0) { diff --git a/base/src/org/compiere/model/MUOMConversion.java b/base/src/org/compiere/model/MUOMConversion.java index c95cefb0c2..b9737c7391 100644 --- a/base/src/org/compiere/model/MUOMConversion.java +++ b/base/src/org/compiere/model/MUOMConversion.java @@ -604,7 +604,7 @@ public class MUOMConversion extends X_C_UOM_Conversion + " AND EXISTS (SELECT 1 FROM M_Product p " + "WHERE C_UOM_Conversion.M_Product_ID=p.M_Product_ID AND C_UOM_Conversion.C_UOM_ID=p.C_UOM_ID)"; List conversions = new Query(ctx, Table_Name, whereClause, null) - .setParameters(new Object[]{M_Product_ID}) + .setParameters(M_Product_ID) .setOnlyActiveRecords(true) .list(); list.addAll(conversions); diff --git a/base/src/org/compiere/model/MUser.java b/base/src/org/compiere/model/MUser.java index 66ced53720..e7a5de22e0 100644 --- a/base/src/org/compiere/model/MUser.java +++ b/base/src/org/compiere/model/MUser.java @@ -74,8 +74,8 @@ public class MUser extends X_AD_User */ public static MUser[] getOfBPartner (Properties ctx, int C_BPartner_ID, String trxName) { - List list = new Query(ctx, MUser.Table_Name, "C_BPartner_ID=?", trxName) - .setParameters(new Object[]{C_BPartner_ID}) + List list = new Query(ctx, I_AD_User.Table_Name, "C_BPartner_ID=?", trxName) + .setParameters(C_BPartner_ID) .setOnlyActiveRecords(true) .list(); diff --git a/base/src/org/compiere/model/MWarehouse.java b/base/src/org/compiere/model/MWarehouse.java index b6b15a7f4b..a41bff78ef 100644 --- a/base/src/org/compiere/model/MWarehouse.java +++ b/base/src/org/compiere/model/MWarehouse.java @@ -78,7 +78,7 @@ public class MWarehouse extends X_M_Warehouse { String whereClause = "IsActive=? AND AD_Org_ID=?"; List list = new Query(ctx, Table_Name, whereClause, null) - .setParameters(new Object[]{"Y", AD_Org_ID}) + .setParameters("Y", AD_Org_ID) .setOrderBy(COLUMNNAME_M_Warehouse_ID) .list(); return list.toArray(new MWarehouse[list.size()]); @@ -95,7 +95,7 @@ public class MWarehouse extends X_M_Warehouse { String whereClause = "IsActive=? AND IsInTransit=? AND AD_Org_ID=?"; List list = new Query(ctx, Table_Name, whereClause, null) - .setParameters(new Object[]{"Y", "Y", AD_Org_ID}) + .setParameters("Y", "Y", AD_Org_ID) .setOrderBy(COLUMNNAME_M_Warehouse_ID) .list(); return list.toArray(new MWarehouse[list.size()]); @@ -160,8 +160,8 @@ public class MWarehouse extends X_M_Warehouse return m_locators; // final String whereClause = "IsActive=? AND M_Warehouse_ID=?"; - List list = new Query(getCtx(), MLocator.Table_Name, whereClause, null) - .setParameters(new Object[]{"Y", getM_Warehouse_ID()}) + List list = new Query(getCtx(), I_M_Locator.Table_Name, whereClause, null) + .setParameters("Y", getM_Warehouse_ID()) .setOrderBy("X,Y,Z") .list(); m_locators = list.toArray(new MLocator[list.size()]);