public class UnionEvaluator extends MEXTransformerEvaluator
Unlike list-based evaluators that return text to be inserted into a query,
this evaluator interacts directly with the MEXPersistenceQueryResults context to
register supplementary queries. These queries are executed and their results
are merged according to the specified set operation.
Example usage:
"{Union SELECT o.id FROM Order o WHERE o.Status = 'active'}"
"{UnionAll @customHandler SELECT p.id FROM Person p}"
| Constructor and Description |
|---|
UnionEvaluator(MEXPersistenceQueryResults _mexQR)
Constructs a new UnionEvaluator.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
canHandle(java.lang.CharSequence s)
Determines if the expression is a Union operation.
|
java.lang.CharSequence |
evaluate(java.lang.CharSequence s,
MEXTransformer transformer)
Evaluates the Union expression by spawning a new QueryHandler and adding it
to the parent MEX context.
|
java.lang.String[] |
getGroups(java.lang.CharSequence s)
Extracts the query components from the expression.
|
public UnionEvaluator(MEXPersistenceQueryResults _mexQR)
_mexQR - the MEX query results context where sub-queries will be registered.public boolean canHandle(java.lang.CharSequence s)
canHandle in class MEXTransformerEvaluators - the expression string to check.true if it begins with Union or UnionAll.public java.lang.String[] getGroups(java.lang.CharSequence s)
throws MEXParseException
s - the raw instruction sequence.MEXParseException - if the syntax does not match the expected pattern.public java.lang.CharSequence evaluate(java.lang.CharSequence s,
MEXTransformer transformer)
This method returns an empty string because the "Union" operation does
not modify the text of the primary query; instead, it registers a
side-car query that is managed by the mexQR logic.
evaluate in interface MEXTransformerEvaluatorIevaluate in class MEXTransformerEvaluators - the instruction sequence.transformer - the active transformer.CharSequence as the query is handled via context registration.java.lang.IllegalArgumentException - if the sub-query initialization fails (e.g. bad OQL syntax).Copyright © 2000-2026 OAshi S.à r.l. All Rights Reserved.