diff --git a/base/src/org/compiere/model/ModelValidationEngine.java b/base/src/org/compiere/model/ModelValidationEngine.java index 7193a2a02b..60339897cd 100644 --- a/base/src/org/compiere/model/ModelValidationEngine.java +++ b/base/src/org/compiere/model/ModelValidationEngine.java @@ -74,10 +74,9 @@ public class ModelValidationEngine Query query = table.createQuery("IsActive='Y'", null); query.setOrderBy("SeqNo"); try { - List entityTypes = query.list(); - for (PO po : entityTypes) + List entityTypes = query.list(); + for (X_AD_ModelValidator entityType : entityTypes) { - X_AD_ModelValidator entityType = (X_AD_ModelValidator)po; String className = entityType.getModelValidationClass(); if (className == null || className.length() == 0) continue; diff --git a/base/src/org/compiere/model/Query.java b/base/src/org/compiere/model/Query.java index 0553f3aa20..9d6bbffa14 100644 --- a/base/src/org/compiere/model/Query.java +++ b/base/src/org/compiere/model/Query.java @@ -27,6 +27,7 @@ import java.util.logging.Level; import org.compiere.util.CLogger; import org.compiere.util.DB; +import org.compiere.util.DBException; import org.compiere.util.Env; /** @@ -86,8 +87,8 @@ public class Query { * @return List * @throws SQLException */ - public List list() throws SQLException { - List list = new ArrayList(); + public List list() throws DBException { + List list = new ArrayList(); POInfo info = POInfo.getPOInfo(Env.getCtx(), table.getAD_Table_ID(), trxName); if (info == null) return null; @@ -117,14 +118,14 @@ public class Query { rs = pstmt.executeQuery (); while (rs.next ()) { - PO po = table.getPO(rs, trxName); + T po = (T)table.getPO(rs, trxName); list.add(po); } } catch (SQLException e) { log.log(Level.SEVERE, sql, e); - throw e; + throw new DBException(e); } finally { DB.close(rs, pstmt); rs = null; pstmt = null;