Reverting usage of MQuery for MTable class.

ADemepire is not even able to start from Eclipse.
Please next time at least try to start ADemepire from Eclipse.
https://sourceforge.net/tracker/index.php?func=detail&aid=2214883&group_id=176962&atid=879335
This commit is contained in:
trifonnt 2010-03-08 08:37:06 +00:00
parent 370a752666
commit 19d419e47d
1 changed files with 32 additions and 9 deletions

View File

@ -50,11 +50,10 @@ import org.compiere.util.Util;
*/
public class MTable extends X_AD_Table
{
/**
*
*/
private static final long serialVersionUID = -2367316254623142732L;
/**
*
*/
private static final long serialVersionUID = -2367316254623142732L;
/**
* Get Table from Cache
@ -98,10 +97,34 @@ public class MTable extends X_AD_Table
}
}
//
final String whereClause = "UPPER("+I_AD_Table.COLUMNNAME_TableName+")=?";
MTable retValue = new Query(ctx,I_AD_Table.Table_Name,whereClause,null)
.setParameters(tableName.toUpperCase())
.first();
MTable retValue = null;
String sql = "SELECT * FROM AD_Table WHERE UPPER(TableName)=?";
PreparedStatement pstmt = null;
try
{
pstmt = DB.prepareStatement (sql, null);
pstmt.setString(1, tableName.toUpperCase());
ResultSet rs = pstmt.executeQuery ();
if (rs.next ())
retValue = new MTable (ctx, rs, null);
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;
}
if (retValue != null)
{