Apply ADempiere Best Practice and change the Collection by List as standard in ADempiere

Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2214883
This commit is contained in:
vpj-cd 2010-03-02 17:15:59 +00:00
parent 3486415202
commit d6e3780968
1 changed files with 23 additions and 18 deletions

View File

@ -17,7 +17,7 @@
package org.compiere.model;
import java.util.Collection;
import java.util.List;
import java.util.Properties;
import org.compiere.util.CLogger;
@ -31,10 +31,11 @@ import org.compiere.util.CLogger;
* <li> https://sourceforge.net/tracker/?func=detail&aid=2947615&group_id=176962&atid=879332
*/
public class MReplicationStrategy extends X_AD_ReplicationStrategy {
/**
*
*/
private static final long serialVersionUID = 1921892820183119329L;
/**
*
*/
private static final long serialVersionUID = -3017484140206284805L;
public static final int REPLICATION_TABLE =0;
public static final int REPLICATION_DOCUMENT =1;
@ -54,11 +55,11 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy {
}
/**
* @return the collection the X_AD_ReplicationTable
* @return the list the X_AD_ReplicationTable
*/
public Collection <X_AD_ReplicationTable> getReplicationTables() {
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())
public List <X_AD_ReplicationTable> getReplicationTables() {
final String whereClause = I_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID+"=?"; // #1
return new Query(getCtx(), I_AD_ReplicationTable.Table_Name, whereClause, get_TrxName())
.setClient_ID()
.setParameters(getAD_ReplicationStrategy_ID())
.setOnlyActiveRecords(true)
@ -68,11 +69,11 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy {
}
/**
* @return the collection the X_AD_ReplicationDocument
* @return the list the X_AD_ReplicationDocument
*/
public Collection<X_AD_ReplicationDocument> getReplicationDocuments() {
String whereClause = "AD_ReplicationStrategy_ID=?"; // #1
return new Query(getCtx(),X_AD_ReplicationDocument.Table_Name,whereClause,get_TrxName())
public List<X_AD_ReplicationDocument> getReplicationDocuments() {
final String whereClause = I_AD_ReplicationDocument.COLUMNNAME_AD_ReplicationStrategy_ID+"=?"; // #1
return new Query(getCtx(),I_AD_ReplicationDocument.Table_Name,whereClause,get_TrxName())
.setClient_ID()
.setParameters(getAD_ReplicationStrategy_ID())
.setOnlyActiveRecords(true)
@ -88,8 +89,9 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy {
*/
public static X_AD_ReplicationTable getReplicationTable(Properties ctx ,int AD_ReplicationStrategy_ID, int AD_Table_ID)
{
final String whereClause = "AD_ReplicationStrategy_ID=? AND AD_Table_ID=?";
return new Query(ctx, X_AD_ReplicationTable.Table_Name, whereClause, null)
final String whereClause = I_AD_ReplicationTable.COLUMNNAME_AD_ReplicationStrategy_ID + "=? AND "
+ I_AD_ReplicationTable.COLUMNNAME_AD_Table_ID + "=?";
return new Query(ctx, I_AD_ReplicationTable.Table_Name, whereClause, null)
.setClient_ID()
.setOnlyActiveRecords(true)
.setApplyAccessFilter(false)
@ -105,8 +107,9 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy {
*/
public static X_AD_ReplicationDocument getReplicationDocument(Properties ctx ,int AD_ReplicationStrategy_ID , int AD_Table_ID)
{
String whereClause = "AD_ReplicationStrategy_ID=? AND AD_Table_ID=?";
return new Query(ctx, X_AD_ReplicationDocument.Table_Name, whereClause, null)
final String whereClause = I_AD_ReplicationDocument.COLUMNNAME_AD_ReplicationStrategy_ID + "=? AND "
+ I_AD_ReplicationDocument.COLUMNNAME_AD_Table_ID + "=?";
return new Query(ctx, I_AD_ReplicationDocument.Table_Name, whereClause, null)
.setClient_ID()
.setOnlyActiveRecords(true)
.setApplyAccessFilter(false)
@ -122,7 +125,9 @@ public class MReplicationStrategy extends X_AD_ReplicationStrategy {
*/
public static X_AD_ReplicationDocument getReplicationDocument(Properties ctx ,int AD_ReplicationStrategy_ID , int AD_Table_ID, int C_DocType_ID)
{
String whereClause = "AD_ReplicationStrategy_ID=? AND AD_Table_ID=? AND C_DocType_ID=?";
final String whereClause = I_AD_ReplicationDocument.COLUMNNAME_AD_ReplicationStrategy_ID + "=? AND "
+ I_AD_ReplicationDocument.COLUMNNAME_AD_Table_ID + "=? AND "
+ I_AD_ReplicationDocument.COLUMNNAME_C_DocType_ID + "=?";
return new Query(ctx, X_AD_ReplicationDocument.Table_Name, whereClause, null)
.setClient_ID()
.setOnlyActiveRecords(true)