Remove SQL code and Replace for Query

Red1 please review your code before to commitment, or commitment after the units test, some implementor are using trunk in production

kind regards
Victor Perez
www.e-evolution.com
Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2214883
This commit is contained in:
vpj-cd 2010-03-07 18:06:05 +00:00
parent 14046997c8
commit 691b689ee7
2 changed files with 12 additions and 9 deletions

View File

@ -31,6 +31,8 @@ import org.compiere.util.CLogger;
public class MBPBankAccount extends X_C_BP_BankAccount public class MBPBankAccount extends X_C_BP_BankAccount
{ {
/** /**
* *
*/ */
@ -45,7 +47,7 @@ public class MBPBankAccount extends X_C_BP_BankAccount
public static MBPBankAccount[] getOfBPartner (Properties ctx, int C_BPartner_ID) public static MBPBankAccount[] getOfBPartner (Properties ctx, int C_BPartner_ID)
{ {
final String whereClause = MBPBankAccount.COLUMNNAME_C_BPartner_ID+"=?"; final String whereClause = MBPBankAccount.COLUMNNAME_C_BPartner_ID+"=?";
List<MBPBankAccount>list = new Query(ctx,MBPBankAccount.COLUMNNAME_C_BPartner_ID,whereClause,null) List<MBPBankAccount>list = new Query(ctx,MBPBankAccount.Table_Name,whereClause,null)
.setParameters(C_BPartner_ID) .setParameters(C_BPartner_ID)
.setOnlyActiveRecords(true) .setOnlyActiveRecords(true)
.list(); .list();

View File

@ -50,6 +50,7 @@ import org.compiere.util.Util;
*/ */
public class MTable extends X_AD_Table public class MTable extends X_AD_Table
{ {
/** /**
* *
*/ */
@ -97,7 +98,7 @@ public class MTable extends X_AD_Table
} }
} }
// //
final String whereClause = I_AD_Table.COLUMNNAME_AD_Table_ID.toUpperCase()+"=?"; final String whereClause = "UPPER("+I_AD_Table.COLUMNNAME_TableName+")=?";
MTable retValue = new Query(ctx,I_AD_Table.Table_Name,whereClause,null) MTable retValue = new Query(ctx,I_AD_Table.Table_Name,whereClause,null)
.setParameters(tableName.toUpperCase()) .setParameters(tableName.toUpperCase())
.first(); .first();