FR: [ 2214883 ] Remove SQL code and Replace for Query
-- JUnit test pending Link to SF Tracker: http://sourceforge.net/support/tracker.php?aid=2214883
This commit is contained in:
parent
3ad07bd33d
commit
f95f2f2f6d
|
@ -20,7 +20,6 @@ import java.awt.Dimension;
|
|||
import java.sql.PreparedStatement;
|
||||
import java.sql.ResultSet;
|
||||
import java.sql.SQLException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Properties;
|
||||
import java.util.logging.Level;
|
||||
|
@ -98,27 +97,11 @@ public class MWindow extends X_AD_Window
|
|||
{
|
||||
if (m_tabs != null && !reload)
|
||||
return m_tabs;
|
||||
String sql = "SELECT * FROM AD_Tab WHERE AD_Window_ID=? ORDER BY SeqNo";
|
||||
ArrayList<MTab> list = new ArrayList<MTab>();
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, trxName);
|
||||
pstmt.setInt (1, getAD_Window_ID());
|
||||
rs = pstmt.executeQuery ();
|
||||
while (rs.next ())
|
||||
list.add (new MTab (getCtx(), rs, trxName));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
log.log(Level.SEVERE, sql, e);
|
||||
}
|
||||
finally
|
||||
{
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
final String whereClause = I_AD_Window.COLUMNNAME_AD_Window_ID+"=?";
|
||||
List<MTab> list = new Query(getCtx(),I_AD_Window.Table_Name,whereClause,trxName)
|
||||
.setParameters(getAD_Window_ID())
|
||||
.setOrderBy("SeqNo")
|
||||
.list();
|
||||
//
|
||||
m_tabs = new MTab[list.size ()];
|
||||
list.toArray (m_tabs);
|
||||
|
@ -196,23 +179,6 @@ public class MWindow extends X_AD_Window
|
|||
|
||||
List<X_AD_WF_Node> list = new Query(ctx,X_AD_WF_Node.Table_Name,whereClause,trxName)
|
||||
.list();
|
||||
PreparedStatement pstmt = null;
|
||||
ResultSet rs = null;
|
||||
try
|
||||
{
|
||||
pstmt = DB.prepareStatement (sql, trxName);
|
||||
rs = pstmt.executeQuery ();
|
||||
while (rs.next ())
|
||||
list.add (new X_AD_WF_Node (ctx, rs, trxName));
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
s_log.log(Level.SEVERE, sql, e);
|
||||
}
|
||||
finally {
|
||||
DB.close(rs, pstmt);
|
||||
rs = null; pstmt = null;
|
||||
}
|
||||
X_AD_WF_Node[] retValue = new X_AD_WF_Node[list.size()];
|
||||
list.toArray (retValue);
|
||||
return retValue;
|
||||
|
|
Loading…
Reference in New Issue