IDEMPIERE-6272 - Model Generator fails in silence when the query does… (#2499)

* IDEMPIERE-6272 - Model Generator fails in silence when the query does not return any record

* IDEMPIERE-6272 - Model Generator fails in silence when the query does not return any record
This commit is contained in:
Diego Ruiz 2024-10-23 13:21:49 +02:00 committed by Carlos Ruiz
parent ecd8563a58
commit f3e5601a13
1 changed files with 6 additions and 0 deletions

View File

@ -909,13 +909,19 @@ public class ModelInterfaceGenerator
{
pstmt = DB.prepareStatement(sql.toString(), null);
rs = pstmt.executeQuery();
boolean isEmpty = true;
while (rs.next())
{
isEmpty = false;
if (type.equals(GEN_SOURCE_INTERFACE))
new ModelInterfaceGenerator(rs.getInt(1), directory.toString(), packageName, columnFilter);
else if (type.equals(GEN_SOURCE_CLASS))
new ModelClassGenerator(rs.getInt(1), directory.toString(), packageName, columnFilter);
}
if (isEmpty)
System.out.println("No data found for the table with name " + tableName);
}
catch (SQLException e)
{