If I have a class A
with attributes A.a
and A.b
, which are both LINKs that can reference other records of class A, how do I - for a given instance of A - find all the other records that reference this instance in their attribute A.a
but not A.b
?
Here I just found how to find all referencing records, not distinguishing by which field is used to reference a given record.
Example for clarification: Let's say there's a class Person
with attributes personalTrainer
and partner
, which are other Person
s. For a given Person
, how do I find all other Person
s (hopefully 0 or 1) which have this one as their partner
, but not their personalTrainer
?
I suggest you to use GraphAPI where all links are automatically managed by OrientDB and you can always cross your relationships in both directions.