Summary
#7164 lets an items: where: condition on the item's function: EntityStatus relation name the status by its seeded NAME, resolved on the raw tree by StatusSymbolResolver.rewriteGeneratesItemsWhere. The parser explicitly allows the item source to be cross-model (fromUses: - IntentParser.java around 7358-7362 sets itemSource = null). For such a source the resolver's statusRelationName(itemEntity) is null and the method returns silently, so { field: Status, value: APPROVED } renders as .eq("Status", "APPROVED") in the generated Java with no diagnostic. The header-level twin two lines above (rewriteGenerates) builds a Target(source, fromUses) and REFUSES a cross-model status name ("a cross-model status must be referenced by its numeric seed id", lines 590-593).
Evidence (origin/master)
components/engine/engine-intent/src/main/java/org/eclipse/dirigible/components/intent/parser/StatusSymbolResolver.java:322-337:
private void rewriteGeneratesItemsWhere(Map<?, ?> generate, String subject) {
Map<?, ?> items = asMap(generate.get("items"));
String itemEntity = items == null ? null : text(items, "from");
String statusRelation = statusRelationName(itemEntity);
if (statusRelation == null) {
return; // <- cross-model item source: silently unresolved
}
Same PR, same family
GlueIntentGenerator.java:1100 puts the authored refuse: message into the descriptor raw and Generate.java.template:257 interpolates it into a Java string literal ("${itemRefuse} (${fromItemEntity} " + unqualified + ")") unescaped. #7154/#7205 introduced JavaLiterals for exactly this class of defect but only wired it into defaultValue; a refuse: message with a quote or backslash breaks the generated repository's compile the same way. The pre-existing "${guard.message}" / "${check.message}" sites in Repository.java.template (211, 1033, 1048, 1053) share the defect.
Fix
Mirror the header-level rule: refuse a status name on a cross-model item source at parse (id-only there, like every other cross-model nomenclature). And route itemRefuse (and the guard/check messages) through JavaLiterals when they are rendered into a literal.
Found reviewing #7164.
Summary
#7164 lets an
items: where:condition on the item'sfunction: EntityStatusrelation name the status by its seeded NAME, resolved on the raw tree byStatusSymbolResolver.rewriteGeneratesItemsWhere. The parser explicitly allows the item source to be cross-model (fromUses:-IntentParser.javaaround 7358-7362 setsitemSource = null). For such a source the resolver'sstatusRelationName(itemEntity)is null and the method returns silently, so{ field: Status, value: APPROVED }renders as.eq("Status", "APPROVED")in the generated Java with no diagnostic. The header-level twin two lines above (rewriteGenerates) builds aTarget(source, fromUses)and REFUSES a cross-model status name ("a cross-model status must be referenced by its numeric seed id", lines 590-593).Evidence (origin/master)
components/engine/engine-intent/src/main/java/org/eclipse/dirigible/components/intent/parser/StatusSymbolResolver.java:322-337:Same PR, same family
GlueIntentGenerator.java:1100puts the authoredrefuse:message into the descriptor raw andGenerate.java.template:257interpolates it into a Java string literal ("${itemRefuse} (${fromItemEntity} " + unqualified + ")") unescaped. #7154/#7205 introducedJavaLiteralsfor exactly this class of defect but only wired it intodefaultValue; arefuse:message with a quote or backslash breaks the generated repository's compile the same way. The pre-existing"${guard.message}"/"${check.message}"sites inRepository.java.template(211, 1033, 1048, 1053) share the defect.Fix
Mirror the header-level rule: refuse a status name on a cross-model item source at parse (id-only there, like every other cross-model nomenclature). And route
itemRefuse(and the guard/check messages) throughJavaLiteralswhen they are rendered into a literal.Found reviewing #7164.