FR: [ 2214883 ] Remove SQL code and Replace for Query
This commit is contained in:
parent
d28e629e75
commit
17137635fc
|
@ -28,6 +28,7 @@ import org.compiere.util.*;
|
||||||
* @author Jorg Janke
|
* @author Jorg Janke
|
||||||
* @version $Id: MCommission.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
|
* @version $Id: MCommission.java,v 1.3 2006/07/30 00:51:02 jjanke Exp $
|
||||||
* @author victor.perez@e-evolution.com www.e-evolution.com [ 1867477 ] http://sourceforge.net/tracker/index.php?func=detail&aid=1867477&group_id=176962&atid=879332
|
* @author victor.perez@e-evolution.com www.e-evolution.com [ 1867477 ] http://sourceforge.net/tracker/index.php?func=detail&aid=1867477&group_id=176962&atid=879332
|
||||||
|
* FR: [ 2214883 ] Remove SQL code and Replace for Query - red1
|
||||||
*/
|
*/
|
||||||
public class MCommission extends X_C_Commission
|
public class MCommission extends X_C_Commission
|
||||||
{
|
{
|
||||||
|
@ -72,35 +73,11 @@ public class MCommission extends X_C_Commission
|
||||||
public MCommissionLine[] getLines()
|
public MCommissionLine[] getLines()
|
||||||
{
|
{
|
||||||
//[ 1867477 ]
|
//[ 1867477 ]
|
||||||
String sql = "SELECT * FROM C_CommissionLine WHERE IsActive='Y' AND C_Commission_ID=? ORDER BY Line";
|
//FR: [ 2214883 ] Remove SQL code and Replace for Query - red1
|
||||||
ArrayList<MCommissionLine> list = new ArrayList<MCommissionLine>();
|
String whereClause = "IsActive='Y' AND C_Commission_ID=?";
|
||||||
PreparedStatement pstmt = null;
|
List<MCommissionLine> list = new Query(getCtx(), MCommissionLine.Table_Name, whereClause, get_TrxName())
|
||||||
try
|
.setParameters(new Object[]{getC_Commission_ID()})
|
||||||
{
|
.list();
|
||||||
pstmt = DB.prepareStatement(sql, get_TrxName());
|
|
||||||
pstmt.setInt(1, getC_Commission_ID());
|
|
||||||
ResultSet rs = pstmt.executeQuery();
|
|
||||||
while (rs.next())
|
|
||||||
list.add(new MCommissionLine(getCtx(), rs, get_TrxName()));
|
|
||||||
rs.close();
|
|
||||||
pstmt.close();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
log.log(Level.SEVERE, sql, e);
|
|
||||||
}
|
|
||||||
try
|
|
||||||
{
|
|
||||||
if (pstmt != null)
|
|
||||||
pstmt.close();
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
catch (Exception e)
|
|
||||||
{
|
|
||||||
pstmt = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Convert
|
// Convert
|
||||||
MCommissionLine[] retValue = new MCommissionLine[list.size()];
|
MCommissionLine[] retValue = new MCommissionLine[list.size()];
|
||||||
list.toArray(retValue);
|
list.toArray(retValue);
|
||||||
|
|
Loading…
Reference in New Issue