IDEMPIERE-3916 Better error message to help locating data problems
This commit is contained in:
parent
1d95cc5cba
commit
45498090f7
|
@ -917,7 +917,7 @@ public class MoveClient extends SvrProcess {
|
||||||
}
|
}
|
||||||
if (convertedId < 0) {
|
if (convertedId < 0) {
|
||||||
// not found in the table - try to get it again - could be missed in first pass
|
// not found in the table - try to get it again - could be missed in first pass
|
||||||
convertedId = getLocalIDFor(convertTable, id);
|
convertedId = getLocalIDFor(convertTable, id, tableName);
|
||||||
if (convertedId < 0) {
|
if (convertedId < 0) {
|
||||||
if (("Record_ID".equalsIgnoreCase(columnName) && table.getColumnIndex("AD_Table_ID") > 0)
|
if (("Record_ID".equalsIgnoreCase(columnName) && table.getColumnIndex("AD_Table_ID") > 0)
|
||||||
|| (("Node_ID".equalsIgnoreCase(columnName) || "Parent_ID".equalsIgnoreCase(columnName))
|
|| (("Node_ID".equalsIgnoreCase(columnName) || "Parent_ID".equalsIgnoreCase(columnName))
|
||||||
|
@ -1118,7 +1118,7 @@ public class MoveClient extends SvrProcess {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private int getLocalIDFor(String tableName, int foreignId) {
|
private int getLocalIDFor(String tableName, int foreignId, String tableNameSource) {
|
||||||
String uuidCol = MTable.getUUIDColumnName(tableName);
|
String uuidCol = MTable.getUUIDColumnName(tableName);
|
||||||
StringBuilder sqlRemoteUUSB = new StringBuilder()
|
StringBuilder sqlRemoteUUSB = new StringBuilder()
|
||||||
.append("SELECT ").append(uuidCol).append(" FROM ").append(tableName)
|
.append("SELECT ").append(uuidCol).append(" FROM ").append(tableName)
|
||||||
|
@ -1134,7 +1134,7 @@ public class MoveClient extends SvrProcess {
|
||||||
if (rs.next())
|
if (rs.next())
|
||||||
remoteUUID = rs.getString(1);
|
remoteUUID = rs.getString(1);
|
||||||
} catch (SQLException e) {
|
} catch (SQLException e) {
|
||||||
throw new AdempiereException("Could not execute external query: " + sqlRemoteUU + "\nCause = " + e.getLocalizedMessage());
|
throw new AdempiereException("Could not execute external query for table " + tableNameSource + ": " + sqlRemoteUU + "\nCause = " + e.getLocalizedMessage());
|
||||||
} finally {
|
} finally {
|
||||||
DB.close(rs, stmtUU);
|
DB.close(rs, stmtUU);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue