IDEMPIERE-3175 Found 2pack problems when UUID is filled with external values

This commit is contained in:
Carlos Ruiz 2016-09-03 17:29:17 +02:00
parent 1ebbb7b14e
commit 3c4b899752
2 changed files with 3 additions and 3 deletions

View File

@ -489,7 +489,7 @@ public abstract class AbstractElementHandler implements ElementHandler {
if (element.properties.containsKey(uuidColumn)) {
uuid = element.properties.get(uuidColumn).contents.toString();
}
return (uuid != null && uuid.trim().length() == 36);
return (uuid != null && uuid.trim().length() <= 36);
}
protected String getUUIDKey(PIPOContext ctx, Element element) {
@ -497,7 +497,7 @@ public abstract class AbstractElementHandler implements ElementHandler {
String uuidColumn = PO.getUUIDColumnName(tableName);
if (element.properties.containsKey(uuidColumn)) {
String uuid = element.properties.get(uuidColumn).contents.toString();
if (uuid != null && uuid.trim().length() == 36)
if (uuid != null && uuid.trim().length() <= 36)
return uuid.trim();
}
return null;

View File

@ -82,7 +82,7 @@ public class POFinder {
String idColumn = tableName + "_ID";
if (element.properties.containsKey(uuidColumn)) {
String uuid = element.properties.get(uuidColumn).contents.toString();
if (uuid != null && uuid.trim().length() == 36) {
if (uuid != null && uuid.trim().length() <= 36) {
uuid = uuid.trim();
String targetUUID = Env.getAD_Client_ID(ctx.ctx) > 0 ? getTargetUUID(ctx.ctx, tableName, uuid, ctx.trx.getTrxName()) : uuid;
Query query = new Query(ctx.ctx, tableName, uuidColumn+"=?", getTrxName(ctx));