Skip to content

Commit

Permalink
IDEMPIERE-5567 Trl Export for table TestUU_Trl (idempiere#2207)
Browse files Browse the repository at this point in the history
- fix throwing TestUU_Trl org.postgresql.util.PSQLException: ERROR: operator does not exist: character varying <= integer Hint: No operator matches the given name and argument types. You might need to add explicit type casts. Position: 268
- change the process to explicitly break when a DB exception happens
  • Loading branch information
CarlosRuiz-globalqss authored Jan 26, 2024
1 parent 6acc6f3 commit ef1468d
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions org.adempiere.base/src/org/compiere/install/Translation.java
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,12 @@ public String exportTrl (String directory, int AD_Client_ID, String AD_Language,
sql.append (haveWhere ? " AND " : " WHERE ").append ("o.IsCentrallyMaintained='N'");
haveWhere = true;
}
if (AD_Client_ID >= 0)
if (AD_Client_ID >= 0) {
sql.append(haveWhere ? " AND " : " WHERE ").append("o.AD_Client_ID=").append(AD_Client_ID);
haveWhere = true;
}

if (onlyCentralized)
if (onlyCentralized && keyColumn.endsWith("_ID"))
sql.append(haveWhere ? " AND " : " WHERE ").append(" o.").append(keyColumn).append("<=").append(MTable.MAX_OFFICIAL_ID).append(" AND o.IsActive = 'Y'");

sql.append(" ORDER BY t.").append(keyColumn);
Expand Down Expand Up @@ -323,15 +325,9 @@ public String exportTrl (String directory, int AD_Client_ID, String AD_Language,
// Close writer - teo_sarca [ 1705883 ]
writer.close();
}
catch (SQLException e)
{
log.log(Level.SEVERE, sql.toString(), e);
return e.toString();
}
catch (Exception e)
{
log.log(Level.SEVERE, "", e);
return e.toString();
throw new AdempiereException(e.getLocalizedMessage(), e);
}
finally
{
Expand Down

0 comments on commit ef1468d

Please sign in to comment.