make sure join-name-chain for record locks ends at the expected join table

This commit is contained in:
2024-04-18 20:44:38 -05:00
parent 09fb9a9502
commit 974b90f0b7
2 changed files with 8 additions and 1 deletions

View File

@ -749,6 +749,10 @@ public class QInstanceValidator
{
if(assertCondition(CollectionUtils.nullSafeHasContents(recordSecurityLock.getJoinNameChain()), prefix + "field name " + fieldName + " looks like a join (has a dot), but no joinNameChain was given."))
{
String[] split = fieldName.split("\\.");
String joinTableName = split[0];
String joinFieldName = split[1];
List<QueryJoin> joins = new ArrayList<>();
///////////////////////////////////////////////////////////////////////////////////////////////////
@ -790,6 +794,8 @@ public class QInstanceValidator
}
}
assertCondition(Objects.equals(tmpTable.getName(), joinTableName), prefix + "has a joinNameChain doesn't end in the expected table [" + joinTableName + "]");
assertCondition(findField(qInstance, table, joins, fieldName), prefix + "has an unrecognized fieldName: " + fieldName);
}
}