* [ 1644310 ] Rev. 1292 hangs on start

This commit is contained in:
Heng Sin Low 2007-01-25 14:26:32 +00:00
parent b348ec4bf7
commit 95bc31403e
1 changed files with 29 additions and 6 deletions

View File

@ -531,6 +531,8 @@ public final class MRole extends X_AD_Role
private HashMap<Integer,String> m_tableAccessLevel = null;
/** Table Name */
private HashMap<String,Integer> m_tableName = null;
/** View Name */
private Set<String> m_viewName = null;
/** Window Access */
private HashMap<Integer,Boolean> m_windowAccess = null;
@ -801,9 +803,10 @@ public final class MRole extends X_AD_Role
if (m_tableAccessLevel != null && m_tableName != null && !reload)
return;
m_tableAccessLevel = new HashMap<Integer,String>(300);
m_tableName = new HashMap<String,Integer>(300);
m_tableName = new HashMap<String,Integer>(300);
m_viewName = new HashSet<String>(300);
PreparedStatement pstmt = null;
String sql = "SELECT AD_Table_ID, AccessLevel, TableName "
String sql = "SELECT AD_Table_ID, AccessLevel, TableName, IsView "
+ "FROM AD_Table WHERE IsActive='Y'";
try
{
@ -812,8 +815,14 @@ public final class MRole extends X_AD_Role
while (rs.next())
{
Integer ii = new Integer(rs.getInt(1));
m_tableAccessLevel.put(ii, rs.getString(2));
m_tableName.put(rs.getString(3), ii);
m_tableAccessLevel.put(ii, rs.getString(2));
String tableName = rs.getString(3);
m_tableName.put(tableName, ii);
String isView = rs.getString(4);
if ("Y".equals(isView))
{
m_viewName.add(tableName);
}
}
rs.close();
pstmt.close();
@ -835,7 +844,16 @@ public final class MRole extends X_AD_Role
}
log.fine("#" + m_tableAccessLevel.size());
} // loadTableAccessLevel
/**
* Check if tableName is a view
* @param tableName
* @return boolean
*/
private boolean isView(String tableName)
{
return m_viewName.contains(tableName);
}
/**
* Load Column Access
@ -1659,7 +1677,12 @@ public final class MRole extends X_AD_Role
// ** Data Access **
for (int i = 0; i < ti.length; i++)
{
String TableName = ti[i].getTableName();
String TableName = ti[i].getTableName();
//[ 1644310 ] Rev. 1292 hangs on start
if (TableName.toUpperCase().endsWith("_TRL")) continue;
if (isView(TableName)) continue;
int AD_Table_ID = getAD_Table_ID (TableName);
// Data Table Access
if (AD_Table_ID != 0 && !isTableAccess(AD_Table_ID, !rw))