diff options
author | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-26 18:23:13 -0400 |
---|---|---|
committer | ArenBabikian <aren.babikian@mail.mcgill.ca> | 2020-04-26 18:23:13 -0400 |
commit | c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e (patch) | |
tree | 0c2e212e4e95c1d2311629128641d5cd561210f3 /Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv15.java | |
parent | Merge branch 'Attribute-Solver' (diff) | |
download | VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.tar.gz VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.tar.zst VIATRA-Generator-c0a758eedd457a5d8eb9f1a6c17fc24143aabb3e.zip |
Add PLEDGE case study files
Diffstat (limited to 'Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv15.java')
-rw-r--r-- | Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv15.java | 637 |
1 files changed, 637 insertions, 0 deletions
diff --git a/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv15.java b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv15.java new file mode 100644 index 00000000..70d0a290 --- /dev/null +++ b/Tests/MODELS2020-CaseStudies/case.study.pledge.queries/src-gen/queries/X_inv15.java | |||
@@ -0,0 +1,637 @@ | |||
1 | /** | ||
2 | * Generated from platform:/resource/case.study.a.queries/src/queries/case_study_A.vql | ||
3 | */ | ||
4 | package queries; | ||
5 | |||
6 | import Taxation.External_Allowance; | ||
7 | import java.util.Arrays; | ||
8 | import java.util.Collection; | ||
9 | import java.util.LinkedHashSet; | ||
10 | import java.util.List; | ||
11 | import java.util.Objects; | ||
12 | import java.util.Optional; | ||
13 | import java.util.Set; | ||
14 | import java.util.function.Consumer; | ||
15 | import java.util.stream.Collectors; | ||
16 | import java.util.stream.Stream; | ||
17 | import org.apache.log4j.Logger; | ||
18 | import org.eclipse.emf.ecore.EClass; | ||
19 | import org.eclipse.viatra.query.runtime.api.IPatternMatch; | ||
20 | import org.eclipse.viatra.query.runtime.api.IQuerySpecification; | ||
21 | import org.eclipse.viatra.query.runtime.api.ViatraQueryEngine; | ||
22 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFPQuery; | ||
23 | import org.eclipse.viatra.query.runtime.api.impl.BaseGeneratedEMFQuerySpecification; | ||
24 | import org.eclipse.viatra.query.runtime.api.impl.BaseMatcher; | ||
25 | import org.eclipse.viatra.query.runtime.api.impl.BasePatternMatch; | ||
26 | import org.eclipse.viatra.query.runtime.emf.types.EClassTransitiveInstancesKey; | ||
27 | import org.eclipse.viatra.query.runtime.emf.types.EStructuralFeatureInstancesKey; | ||
28 | import org.eclipse.viatra.query.runtime.matchers.backend.QueryEvaluationHint; | ||
29 | import org.eclipse.viatra.query.runtime.matchers.psystem.PBody; | ||
30 | import org.eclipse.viatra.query.runtime.matchers.psystem.PVariable; | ||
31 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.Equality; | ||
32 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicdeferred.ExportedParameter; | ||
33 | import org.eclipse.viatra.query.runtime.matchers.psystem.basicenumerables.TypeConstraint; | ||
34 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameter; | ||
35 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PParameterDirection; | ||
36 | import org.eclipse.viatra.query.runtime.matchers.psystem.queries.PVisibility; | ||
37 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuple; | ||
38 | import org.eclipse.viatra.query.runtime.matchers.tuple.Tuples; | ||
39 | import org.eclipse.viatra.query.runtime.util.ViatraQueryLoggingUtil; | ||
40 | |||
41 | /** | ||
42 | * A pattern-specific query specification that can instantiate Matcher in a type-safe way. | ||
43 | * | ||
44 | * <p>Original source: | ||
45 | * <code><pre> | ||
46 | * pattern x_inv15(ea : External_Allowance) { | ||
47 | * External_Allowance.person(ea, child); | ||
48 | * Household.children(h, child);//only one due to multiplicity | ||
49 | * Household.parents.individual_A(h, iA); | ||
50 | * Tax_Payer(iA); | ||
51 | * External_Allowance.reciver(ea, iA); | ||
52 | * } or { | ||
53 | * External_Allowance.person(ea, child); | ||
54 | * Household.children(h, child);//only one due to multiplicity | ||
55 | * Household.parents.individual_B(h, iB); | ||
56 | * Tax_Payer(iB); | ||
57 | * External_Allowance.reciver(ea, iB); | ||
58 | * } | ||
59 | * </pre></code> | ||
60 | * | ||
61 | * @see Matcher | ||
62 | * @see Match | ||
63 | * | ||
64 | */ | ||
65 | @SuppressWarnings("all") | ||
66 | public final class X_inv15 extends BaseGeneratedEMFQuerySpecification<X_inv15.Matcher> { | ||
67 | /** | ||
68 | * Pattern-specific match representation of the queries.x_inv15 pattern, | ||
69 | * to be used in conjunction with {@link Matcher}. | ||
70 | * | ||
71 | * <p>Class fields correspond to parameters of the pattern. Fields with value null are considered unassigned. | ||
72 | * Each instance is a (possibly partial) substitution of pattern parameters, | ||
73 | * usable to represent a match of the pattern in the result of a query, | ||
74 | * or to specify the bound (fixed) input parameters when issuing a query. | ||
75 | * | ||
76 | * @see Matcher | ||
77 | * | ||
78 | */ | ||
79 | public static abstract class Match extends BasePatternMatch { | ||
80 | private External_Allowance fEa; | ||
81 | |||
82 | private static List<String> parameterNames = makeImmutableList("ea"); | ||
83 | |||
84 | private Match(final External_Allowance pEa) { | ||
85 | this.fEa = pEa; | ||
86 | } | ||
87 | |||
88 | @Override | ||
89 | public Object get(final String parameterName) { | ||
90 | switch(parameterName) { | ||
91 | case "ea": return this.fEa; | ||
92 | default: return null; | ||
93 | } | ||
94 | } | ||
95 | |||
96 | @Override | ||
97 | public Object get(final int index) { | ||
98 | switch(index) { | ||
99 | case 0: return this.fEa; | ||
100 | default: return null; | ||
101 | } | ||
102 | } | ||
103 | |||
104 | public External_Allowance getEa() { | ||
105 | return this.fEa; | ||
106 | } | ||
107 | |||
108 | @Override | ||
109 | public boolean set(final String parameterName, final Object newValue) { | ||
110 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
111 | if ("ea".equals(parameterName) ) { | ||
112 | this.fEa = (External_Allowance) newValue; | ||
113 | return true; | ||
114 | } | ||
115 | return false; | ||
116 | } | ||
117 | |||
118 | public void setEa(final External_Allowance pEa) { | ||
119 | if (!isMutable()) throw new java.lang.UnsupportedOperationException(); | ||
120 | this.fEa = pEa; | ||
121 | } | ||
122 | |||
123 | @Override | ||
124 | public String patternName() { | ||
125 | return "queries.x_inv15"; | ||
126 | } | ||
127 | |||
128 | @Override | ||
129 | public List<String> parameterNames() { | ||
130 | return X_inv15.Match.parameterNames; | ||
131 | } | ||
132 | |||
133 | @Override | ||
134 | public Object[] toArray() { | ||
135 | return new Object[]{fEa}; | ||
136 | } | ||
137 | |||
138 | @Override | ||
139 | public X_inv15.Match toImmutable() { | ||
140 | return isMutable() ? newMatch(fEa) : this; | ||
141 | } | ||
142 | |||
143 | @Override | ||
144 | public String prettyPrint() { | ||
145 | StringBuilder result = new StringBuilder(); | ||
146 | result.append("\"ea\"=" + prettyPrintValue(fEa)); | ||
147 | return result.toString(); | ||
148 | } | ||
149 | |||
150 | @Override | ||
151 | public int hashCode() { | ||
152 | return Objects.hash(fEa); | ||
153 | } | ||
154 | |||
155 | @Override | ||
156 | public boolean equals(final Object obj) { | ||
157 | if (this == obj) | ||
158 | return true; | ||
159 | if (obj == null) { | ||
160 | return false; | ||
161 | } | ||
162 | if ((obj instanceof X_inv15.Match)) { | ||
163 | X_inv15.Match other = (X_inv15.Match) obj; | ||
164 | return Objects.equals(fEa, other.fEa); | ||
165 | } else { | ||
166 | // this should be infrequent | ||
167 | if (!(obj instanceof IPatternMatch)) { | ||
168 | return false; | ||
169 | } | ||
170 | IPatternMatch otherSig = (IPatternMatch) obj; | ||
171 | return Objects.equals(specification(), otherSig.specification()) && Arrays.deepEquals(toArray(), otherSig.toArray()); | ||
172 | } | ||
173 | } | ||
174 | |||
175 | @Override | ||
176 | public X_inv15 specification() { | ||
177 | return X_inv15.instance(); | ||
178 | } | ||
179 | |||
180 | /** | ||
181 | * Returns an empty, mutable match. | ||
182 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
183 | * | ||
184 | * @return the empty match. | ||
185 | * | ||
186 | */ | ||
187 | public static X_inv15.Match newEmptyMatch() { | ||
188 | return new Mutable(null); | ||
189 | } | ||
190 | |||
191 | /** | ||
192 | * Returns a mutable (partial) match. | ||
193 | * Fields of the mutable match can be filled to create a partial match, usable as matcher input. | ||
194 | * | ||
195 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
196 | * @return the new, mutable (partial) match object. | ||
197 | * | ||
198 | */ | ||
199 | public static X_inv15.Match newMutableMatch(final External_Allowance pEa) { | ||
200 | return new Mutable(pEa); | ||
201 | } | ||
202 | |||
203 | /** | ||
204 | * Returns a new (partial) match. | ||
205 | * This can be used e.g. to call the matcher with a partial match. | ||
206 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
207 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
208 | * @return the (partial) match object. | ||
209 | * | ||
210 | */ | ||
211 | public static X_inv15.Match newMatch(final External_Allowance pEa) { | ||
212 | return new Immutable(pEa); | ||
213 | } | ||
214 | |||
215 | private static final class Mutable extends X_inv15.Match { | ||
216 | Mutable(final External_Allowance pEa) { | ||
217 | super(pEa); | ||
218 | } | ||
219 | |||
220 | @Override | ||
221 | public boolean isMutable() { | ||
222 | return true; | ||
223 | } | ||
224 | } | ||
225 | |||
226 | private static final class Immutable extends X_inv15.Match { | ||
227 | Immutable(final External_Allowance pEa) { | ||
228 | super(pEa); | ||
229 | } | ||
230 | |||
231 | @Override | ||
232 | public boolean isMutable() { | ||
233 | return false; | ||
234 | } | ||
235 | } | ||
236 | } | ||
237 | |||
238 | /** | ||
239 | * Generated pattern matcher API of the queries.x_inv15 pattern, | ||
240 | * providing pattern-specific query methods. | ||
241 | * | ||
242 | * <p>Use the pattern matcher on a given model via {@link #on(ViatraQueryEngine)}, | ||
243 | * e.g. in conjunction with {@link ViatraQueryEngine#on(QueryScope)}. | ||
244 | * | ||
245 | * <p>Matches of the pattern will be represented as {@link Match}. | ||
246 | * | ||
247 | * <p>Original source: | ||
248 | * <code><pre> | ||
249 | * pattern x_inv15(ea : External_Allowance) { | ||
250 | * External_Allowance.person(ea, child); | ||
251 | * Household.children(h, child);//only one due to multiplicity | ||
252 | * Household.parents.individual_A(h, iA); | ||
253 | * Tax_Payer(iA); | ||
254 | * External_Allowance.reciver(ea, iA); | ||
255 | * } or { | ||
256 | * External_Allowance.person(ea, child); | ||
257 | * Household.children(h, child);//only one due to multiplicity | ||
258 | * Household.parents.individual_B(h, iB); | ||
259 | * Tax_Payer(iB); | ||
260 | * External_Allowance.reciver(ea, iB); | ||
261 | * } | ||
262 | * </pre></code> | ||
263 | * | ||
264 | * @see Match | ||
265 | * @see X_inv15 | ||
266 | * | ||
267 | */ | ||
268 | public static class Matcher extends BaseMatcher<X_inv15.Match> { | ||
269 | /** | ||
270 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
271 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
272 | * | ||
273 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
274 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
275 | * | ||
276 | */ | ||
277 | public static X_inv15.Matcher on(final ViatraQueryEngine engine) { | ||
278 | // check if matcher already exists | ||
279 | Matcher matcher = engine.getExistingMatcher(querySpecification()); | ||
280 | if (matcher == null) { | ||
281 | matcher = (Matcher)engine.getMatcher(querySpecification()); | ||
282 | } | ||
283 | return matcher; | ||
284 | } | ||
285 | |||
286 | /** | ||
287 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
288 | * @return an initialized matcher | ||
289 | * @noreference This method is for internal matcher initialization by the framework, do not call it manually. | ||
290 | * | ||
291 | */ | ||
292 | public static X_inv15.Matcher create() { | ||
293 | return new Matcher(); | ||
294 | } | ||
295 | |||
296 | private static final int POSITION_EA = 0; | ||
297 | |||
298 | private static final Logger LOGGER = ViatraQueryLoggingUtil.getLogger(X_inv15.Matcher.class); | ||
299 | |||
300 | /** | ||
301 | * Initializes the pattern matcher within an existing VIATRA Query engine. | ||
302 | * If the pattern matcher is already constructed in the engine, only a light-weight reference is returned. | ||
303 | * | ||
304 | * @param engine the existing VIATRA Query engine in which this matcher will be created. | ||
305 | * @throws ViatraQueryRuntimeException if an error occurs during pattern matcher creation | ||
306 | * | ||
307 | */ | ||
308 | private Matcher() { | ||
309 | super(querySpecification()); | ||
310 | } | ||
311 | |||
312 | /** | ||
313 | * Returns the set of all matches of the pattern that conform to the given fixed values of some parameters. | ||
314 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
315 | * @return matches represented as a Match object. | ||
316 | * | ||
317 | */ | ||
318 | public Collection<X_inv15.Match> getAllMatches(final External_Allowance pEa) { | ||
319 | return rawStreamAllMatches(new Object[]{pEa}).collect(Collectors.toSet()); | ||
320 | } | ||
321 | |||
322 | /** | ||
323 | * Returns a stream of all matches of the pattern that conform to the given fixed values of some parameters. | ||
324 | * </p> | ||
325 | * <strong>NOTE</strong>: It is important not to modify the source model while the stream is being processed. | ||
326 | * If the match set of the pattern changes during processing, the contents of the stream is <strong>undefined</strong>. | ||
327 | * In such cases, either rely on {@link #getAllMatches()} or collect the results of the stream in end-user code. | ||
328 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
329 | * @return a stream of matches represented as a Match object. | ||
330 | * | ||
331 | */ | ||
332 | public Stream<X_inv15.Match> streamAllMatches(final External_Allowance pEa) { | ||
333 | return rawStreamAllMatches(new Object[]{pEa}); | ||
334 | } | ||
335 | |||
336 | /** | ||
337 | * Returns an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
338 | * Neither determinism nor randomness of selection is guaranteed. | ||
339 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
340 | * @return a match represented as a Match object, or null if no match is found. | ||
341 | * | ||
342 | */ | ||
343 | public Optional<X_inv15.Match> getOneArbitraryMatch(final External_Allowance pEa) { | ||
344 | return rawGetOneArbitraryMatch(new Object[]{pEa}); | ||
345 | } | ||
346 | |||
347 | /** | ||
348 | * Indicates whether the given combination of specified pattern parameters constitute a valid pattern match, | ||
349 | * under any possible substitution of the unspecified parameters (if any). | ||
350 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
351 | * @return true if the input is a valid (partial) match of the pattern. | ||
352 | * | ||
353 | */ | ||
354 | public boolean hasMatch(final External_Allowance pEa) { | ||
355 | return rawHasMatch(new Object[]{pEa}); | ||
356 | } | ||
357 | |||
358 | /** | ||
359 | * Returns the number of all matches of the pattern that conform to the given fixed values of some parameters. | ||
360 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
361 | * @return the number of pattern matches found. | ||
362 | * | ||
363 | */ | ||
364 | public int countMatches(final External_Allowance pEa) { | ||
365 | return rawCountMatches(new Object[]{pEa}); | ||
366 | } | ||
367 | |||
368 | /** | ||
369 | * Executes the given processor on an arbitrarily chosen match of the pattern that conforms to the given fixed values of some parameters. | ||
370 | * Neither determinism nor randomness of selection is guaranteed. | ||
371 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
372 | * @param processor the action that will process the selected match. | ||
373 | * @return true if the pattern has at least one match with the given parameter values, false if the processor was not invoked | ||
374 | * | ||
375 | */ | ||
376 | public boolean forOneArbitraryMatch(final External_Allowance pEa, final Consumer<? super X_inv15.Match> processor) { | ||
377 | return rawForOneArbitraryMatch(new Object[]{pEa}, processor); | ||
378 | } | ||
379 | |||
380 | /** | ||
381 | * Returns a new (partial) match. | ||
382 | * This can be used e.g. to call the matcher with a partial match. | ||
383 | * <p>The returned match will be immutable. Use {@link #newEmptyMatch()} to obtain a mutable match object. | ||
384 | * @param pEa the fixed value of pattern parameter ea, or null if not bound. | ||
385 | * @return the (partial) match object. | ||
386 | * | ||
387 | */ | ||
388 | public X_inv15.Match newMatch(final External_Allowance pEa) { | ||
389 | return X_inv15.Match.newMatch(pEa); | ||
390 | } | ||
391 | |||
392 | /** | ||
393 | * Retrieve the set of values that occur in matches for ea. | ||
394 | * @return the Set of all values or empty set if there are no matches | ||
395 | * | ||
396 | */ | ||
397 | protected Stream<External_Allowance> rawStreamAllValuesOfea(final Object[] parameters) { | ||
398 | return rawStreamAllValues(POSITION_EA, parameters).map(External_Allowance.class::cast); | ||
399 | } | ||
400 | |||
401 | /** | ||
402 | * Retrieve the set of values that occur in matches for ea. | ||
403 | * @return the Set of all values or empty set if there are no matches | ||
404 | * | ||
405 | */ | ||
406 | public Set<External_Allowance> getAllValuesOfea() { | ||
407 | return rawStreamAllValuesOfea(emptyArray()).collect(Collectors.toSet()); | ||
408 | } | ||
409 | |||
410 | /** | ||
411 | * Retrieve the set of values that occur in matches for ea. | ||
412 | * @return the Set of all values or empty set if there are no matches | ||
413 | * | ||
414 | */ | ||
415 | public Stream<External_Allowance> streamAllValuesOfea() { | ||
416 | return rawStreamAllValuesOfea(emptyArray()); | ||
417 | } | ||
418 | |||
419 | @Override | ||
420 | protected X_inv15.Match tupleToMatch(final Tuple t) { | ||
421 | try { | ||
422 | return X_inv15.Match.newMatch((External_Allowance) t.get(POSITION_EA)); | ||
423 | } catch(ClassCastException e) { | ||
424 | LOGGER.error("Element(s) in tuple not properly typed!",e); | ||
425 | return null; | ||
426 | } | ||
427 | } | ||
428 | |||
429 | @Override | ||
430 | protected X_inv15.Match arrayToMatch(final Object[] match) { | ||
431 | try { | ||
432 | return X_inv15.Match.newMatch((External_Allowance) match[POSITION_EA]); | ||
433 | } catch(ClassCastException e) { | ||
434 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
435 | return null; | ||
436 | } | ||
437 | } | ||
438 | |||
439 | @Override | ||
440 | protected X_inv15.Match arrayToMatchMutable(final Object[] match) { | ||
441 | try { | ||
442 | return X_inv15.Match.newMutableMatch((External_Allowance) match[POSITION_EA]); | ||
443 | } catch(ClassCastException e) { | ||
444 | LOGGER.error("Element(s) in array not properly typed!",e); | ||
445 | return null; | ||
446 | } | ||
447 | } | ||
448 | |||
449 | /** | ||
450 | * @return the singleton instance of the query specification of this pattern | ||
451 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
452 | * | ||
453 | */ | ||
454 | public static IQuerySpecification<X_inv15.Matcher> querySpecification() { | ||
455 | return X_inv15.instance(); | ||
456 | } | ||
457 | } | ||
458 | |||
459 | private X_inv15() { | ||
460 | super(GeneratedPQuery.INSTANCE); | ||
461 | } | ||
462 | |||
463 | /** | ||
464 | * @return the singleton instance of the query specification | ||
465 | * @throws ViatraQueryRuntimeException if the pattern definition could not be loaded | ||
466 | * | ||
467 | */ | ||
468 | public static X_inv15 instance() { | ||
469 | try{ | ||
470 | return LazyHolder.INSTANCE; | ||
471 | } catch (ExceptionInInitializerError err) { | ||
472 | throw processInitializerError(err); | ||
473 | } | ||
474 | } | ||
475 | |||
476 | @Override | ||
477 | protected X_inv15.Matcher instantiate(final ViatraQueryEngine engine) { | ||
478 | return X_inv15.Matcher.on(engine); | ||
479 | } | ||
480 | |||
481 | @Override | ||
482 | public X_inv15.Matcher instantiate() { | ||
483 | return X_inv15.Matcher.create(); | ||
484 | } | ||
485 | |||
486 | @Override | ||
487 | public X_inv15.Match newEmptyMatch() { | ||
488 | return X_inv15.Match.newEmptyMatch(); | ||
489 | } | ||
490 | |||
491 | @Override | ||
492 | public X_inv15.Match newMatch(final Object... parameters) { | ||
493 | return X_inv15.Match.newMatch((Taxation.External_Allowance) parameters[0]); | ||
494 | } | ||
495 | |||
496 | /** | ||
497 | * Inner class allowing the singleton instance of {@link X_inv15} to be created | ||
498 | * <b>not</b> at the class load time of the outer class, | ||
499 | * but rather at the first call to {@link X_inv15#instance()}. | ||
500 | * | ||
501 | * <p> This workaround is required e.g. to support recursion. | ||
502 | * | ||
503 | */ | ||
504 | private static class LazyHolder { | ||
505 | private static final X_inv15 INSTANCE = new X_inv15(); | ||
506 | |||
507 | /** | ||
508 | * Statically initializes the query specification <b>after</b> the field {@link #INSTANCE} is assigned. | ||
509 | * This initialization order is required to support indirect recursion. | ||
510 | * | ||
511 | * <p> The static initializer is defined using a helper field to work around limitations of the code generator. | ||
512 | * | ||
513 | */ | ||
514 | private static final Object STATIC_INITIALIZER = ensureInitialized(); | ||
515 | |||
516 | public static Object ensureInitialized() { | ||
517 | INSTANCE.ensureInitializedInternal(); | ||
518 | return null; | ||
519 | } | ||
520 | } | ||
521 | |||
522 | private static class GeneratedPQuery extends BaseGeneratedEMFPQuery { | ||
523 | private static final X_inv15.GeneratedPQuery INSTANCE = new GeneratedPQuery(); | ||
524 | |||
525 | private final PParameter parameter_ea = new PParameter("ea", "Taxation.External_Allowance", new EClassTransitiveInstancesKey((EClass)getClassifierLiteralSafe("http:///TaxCard.ecore", "External_Allowance")), PParameterDirection.INOUT); | ||
526 | |||
527 | private final List<PParameter> parameters = Arrays.asList(parameter_ea); | ||
528 | |||
529 | private GeneratedPQuery() { | ||
530 | super(PVisibility.PUBLIC); | ||
531 | } | ||
532 | |||
533 | @Override | ||
534 | public String getFullyQualifiedName() { | ||
535 | return "queries.x_inv15"; | ||
536 | } | ||
537 | |||
538 | @Override | ||
539 | public List<String> getParameterNames() { | ||
540 | return Arrays.asList("ea"); | ||
541 | } | ||
542 | |||
543 | @Override | ||
544 | public List<PParameter> getParameters() { | ||
545 | return parameters; | ||
546 | } | ||
547 | |||
548 | @Override | ||
549 | public Set<PBody> doGetContainedBodies() { | ||
550 | setEvaluationHints(new QueryEvaluationHint(null, QueryEvaluationHint.BackendRequirement.UNSPECIFIED)); | ||
551 | Set<PBody> bodies = new LinkedHashSet<>(); | ||
552 | { | ||
553 | PBody body = new PBody(this); | ||
554 | PVariable var_ea = body.getOrCreateVariableByName("ea"); | ||
555 | PVariable var_child = body.getOrCreateVariableByName("child"); | ||
556 | PVariable var_h = body.getOrCreateVariableByName("h"); | ||
557 | PVariable var_iA = body.getOrCreateVariableByName("iA"); | ||
558 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "External_Allowance"))); | ||
559 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
560 | new ExportedParameter(body, var_ea, parameter_ea) | ||
561 | )); | ||
562 | // External_Allowance.person(ea, child) | ||
563 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "External_Allowance"))); | ||
564 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
565 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "External_Allowance", "person"))); | ||
566 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Dependent"))); | ||
567 | new Equality(body, var__virtual_0_, var_child); | ||
568 | // Household.children(h, child) | ||
569 | new TypeConstraint(body, Tuples.flatTupleOf(var_h), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Household"))); | ||
570 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
571 | new TypeConstraint(body, Tuples.flatTupleOf(var_h, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Household", "children"))); | ||
572 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Dependent"))); | ||
573 | new Equality(body, var__virtual_1_, var_child); | ||
574 | // //only one due to multiplicity Household.parents.individual_A(h, iA) | ||
575 | new TypeConstraint(body, Tuples.flatTupleOf(var_h), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Household"))); | ||
576 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
577 | new TypeConstraint(body, Tuples.flatTupleOf(var_h, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Household", "parents"))); | ||
578 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Legal_Union_Record"))); | ||
579 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
580 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Legal_Union_Record", "individual_A"))); | ||
581 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Physical_Person"))); | ||
582 | new Equality(body, var__virtual_3_, var_iA); | ||
583 | // Tax_Payer(iA) | ||
584 | new TypeConstraint(body, Tuples.flatTupleOf(var_iA), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Tax_Payer"))); | ||
585 | // External_Allowance.reciver(ea, iA) | ||
586 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "External_Allowance"))); | ||
587 | PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}"); | ||
588 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "External_Allowance", "reciver"))); | ||
589 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Physical_Person"))); | ||
590 | new Equality(body, var__virtual_4_, var_iA); | ||
591 | bodies.add(body); | ||
592 | } | ||
593 | { | ||
594 | PBody body = new PBody(this); | ||
595 | PVariable var_ea = body.getOrCreateVariableByName("ea"); | ||
596 | PVariable var_child = body.getOrCreateVariableByName("child"); | ||
597 | PVariable var_h = body.getOrCreateVariableByName("h"); | ||
598 | PVariable var_iB = body.getOrCreateVariableByName("iB"); | ||
599 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "External_Allowance"))); | ||
600 | body.setSymbolicParameters(Arrays.<ExportedParameter>asList( | ||
601 | new ExportedParameter(body, var_ea, parameter_ea) | ||
602 | )); | ||
603 | // External_Allowance.person(ea, child) | ||
604 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "External_Allowance"))); | ||
605 | PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); | ||
606 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "External_Allowance", "person"))); | ||
607 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_0_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Dependent"))); | ||
608 | new Equality(body, var__virtual_0_, var_child); | ||
609 | // Household.children(h, child) | ||
610 | new TypeConstraint(body, Tuples.flatTupleOf(var_h), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Household"))); | ||
611 | PVariable var__virtual_1_ = body.getOrCreateVariableByName(".virtual{1}"); | ||
612 | new TypeConstraint(body, Tuples.flatTupleOf(var_h, var__virtual_1_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Household", "children"))); | ||
613 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_1_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Dependent"))); | ||
614 | new Equality(body, var__virtual_1_, var_child); | ||
615 | // //only one due to multiplicity Household.parents.individual_B(h, iB) | ||
616 | new TypeConstraint(body, Tuples.flatTupleOf(var_h), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Household"))); | ||
617 | PVariable var__virtual_2_ = body.getOrCreateVariableByName(".virtual{2}"); | ||
618 | new TypeConstraint(body, Tuples.flatTupleOf(var_h, var__virtual_2_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Household", "parents"))); | ||
619 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Legal_Union_Record"))); | ||
620 | PVariable var__virtual_3_ = body.getOrCreateVariableByName(".virtual{3}"); | ||
621 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_2_, var__virtual_3_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "Legal_Union_Record", "individual_B"))); | ||
622 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_3_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Physical_Person"))); | ||
623 | new Equality(body, var__virtual_3_, var_iB); | ||
624 | // Tax_Payer(iB) | ||
625 | new TypeConstraint(body, Tuples.flatTupleOf(var_iB), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Tax_Payer"))); | ||
626 | // External_Allowance.reciver(ea, iB) | ||
627 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "External_Allowance"))); | ||
628 | PVariable var__virtual_4_ = body.getOrCreateVariableByName(".virtual{4}"); | ||
629 | new TypeConstraint(body, Tuples.flatTupleOf(var_ea, var__virtual_4_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http:///TaxCard.ecore", "External_Allowance", "reciver"))); | ||
630 | new TypeConstraint(body, Tuples.flatTupleOf(var__virtual_4_), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http:///TaxCard.ecore", "Physical_Person"))); | ||
631 | new Equality(body, var__virtual_4_, var_iB); | ||
632 | bodies.add(body); | ||
633 | } | ||
634 | return bodies; | ||
635 | } | ||
636 | } | ||
637 | } | ||