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.PreparedStatement;
|
||||||
import java.sql.ResultSet;
|
import java.sql.ResultSet;
|
||||||
import java.sql.SQLException;
|
import java.sql.SQLException;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
import java.util.logging.Level;
|
import java.util.logging.Level;
|
||||||
|
@ -98,27 +97,11 @@ public class MWindow extends X_AD_Window
|
||||||
{
|
{
|
||||||
if (m_tabs != null && !reload)
|
if (m_tabs != null && !reload)
|
||||||
return m_tabs;
|
return m_tabs;
|
||||||
String sql = "SELECT * FROM AD_Tab WHERE AD_Window_ID=? ORDER BY SeqNo";
|
final String whereClause = I_AD_Window.COLUMNNAME_AD_Window_ID+"=?";
|
||||||
ArrayList<MTab> list = new ArrayList<MTab>();
|
List<MTab> list = new Query(getCtx(),I_AD_Window.Table_Name,whereClause,trxName)
|
||||||
PreparedStatement pstmt = null;
|
.setParameters(getAD_Window_ID())
|
||||||
ResultSet rs = null;
|
.setOrderBy("SeqNo")
|
||||||
try
|
.list();
|
||||||
{
|
|
||||||
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;
|
|
||||||
}
|
|
||||||
//
|
//
|
||||||
m_tabs = new MTab[list.size ()];
|
m_tabs = new MTab[list.size ()];
|
||||||
list.toArray (m_tabs);
|
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<X_AD_WF_Node> list = new Query(ctx,X_AD_WF_Node.Table_Name,whereClause,trxName)
|
||||||
.list();
|
.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()];
|
X_AD_WF_Node[] retValue = new X_AD_WF_Node[list.size()];
|
||||||
list.toArray (retValue);
|
list.toArray (retValue);
|
||||||
return retValue;
|
return retValue;
|
||||||
|
|
Loading…
Reference in New Issue