MInOutLineMA:

* use new persistence layer
* javadoc fix
This commit is contained in:
teo_sarca 2008-05-30 16:04:21 +00:00
parent b01513d2d3
commit d57133a358
1 changed files with 16 additions and 42 deletions

View File

@ -16,11 +16,12 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.model; package org.compiere.model;
import java.math.*; import java.math.BigDecimal;
import java.sql.*; import java.sql.ResultSet;
import java.util.*; import java.util.List;
import java.util.logging.*; import java.util.Properties;
import org.compiere.util.*;
import org.compiere.util.DB;
/** /**
* Shipment Material Allocation * Shipment Material Allocation
@ -39,37 +40,10 @@ public class MInOutLineMA extends X_M_InOutLineMA
*/ */
public static MInOutLineMA[] get (Properties ctx, int M_InOutLine_ID, String trxName) public static MInOutLineMA[] get (Properties ctx, int M_InOutLine_ID, String trxName)
{ {
ArrayList<MInOutLineMA> list = new ArrayList<MInOutLineMA>(); Query query = MTable.get(ctx, MInOutLineMA.Table_Name)
String sql = "SELECT * FROM M_InOutLineMA WHERE M_InOutLine_ID=?"; .createQuery(MInOutLineMA.COLUMNNAME_M_InOutLine_ID+"=?", trxName);
PreparedStatement pstmt = null; query.setParameters(new Object[]{M_InOutLine_ID});
try List<MInOutLineMA> list = query.list();
{
pstmt = DB.prepareStatement (sql, trxName);
pstmt.setInt (1, M_InOutLine_ID);
ResultSet rs = pstmt.executeQuery ();
while (rs.next ())
{
list.add (new MInOutLineMA (ctx, rs, trxName));
}
rs.close ();
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
s_log.log (Level.SEVERE, sql, e);
}
try
{
if (pstmt != null)
pstmt.close ();
pstmt = null;
}
catch (Exception e)
{
pstmt = null;
}
MInOutLineMA[] retValue = new MInOutLineMA[list.size ()]; MInOutLineMA[] retValue = new MInOutLineMA[list.size ()];
list.toArray (retValue); list.toArray (retValue);
return retValue; return retValue;
@ -102,8 +76,8 @@ public class MInOutLineMA extends X_M_InOutLineMA
} // deleteInOutLineMA } // deleteInOutLineMA
/** Logger */ // /** Logger */
private static CLogger s_log = CLogger.getCLogger (MInOutLineMA.class); // private static CLogger s_log = CLogger.getCLogger (MInOutLineMA.class);
/************************************************************************** /**************************************************************************
* Standard Constructor * Standard Constructor