File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
model-server-lib/src/main/kotlin/org/modelix/model/server/light Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 13
13
*/
14
14
package org.modelix.model.server.light
15
15
16
- import org.modelix.model.api.INode
17
- import org.modelix.model.api.INodeReferenceSerializer
18
- import org.modelix.model.api.getAncestors
19
- import org.modelix.model.api.getDescendants
16
+ import org.modelix.model.api.*
20
17
import org.modelix.model.server.api.AndFilter
21
18
import org.modelix.model.server.api.ContainsOperator
22
19
import org.modelix.model.server.api.EndsWithOperator
@@ -53,7 +50,18 @@ fun RootOrSubquery.queryNodes(node: INode): Sequence<INode> {
53
50
is QueryChildren -> node.getChildren(this .role).asSequence()
54
51
is QueryDescendants -> node.getDescendants(false )
55
52
is QueryParent -> listOfNotNull(node.parent).asSequence()
56
- is QueryReference -> listOfNotNull(node.getReferenceTarget(this .role)).asSequence()
53
+ is QueryReference -> {
54
+ val link = try {
55
+ node.resolveReferenceLink(this .role)
56
+ } catch (ex: Exception ) {
57
+ null
58
+ }
59
+ if (link == null ) {
60
+ emptySequence()
61
+ } else {
62
+ listOfNotNull(node.getReferenceTarget(link)).asSequence()
63
+ }
64
+ }
57
65
is QueryReferences -> node.getAllReferences()
58
66
is QueryReferencesAndChildren -> node.getReferencesAndChildren(recursive)
59
67
is QueryById -> {
You can’t perform that action at this time.
0 commit comments