Hi Luca. Based on your reply I have made an Edge and extended it by two another edges that I need to create Composite Unique Constraint for.
*create class Person extends V* *create class Car extends V* *create class ServiceStation extends V* *create class Edge extends E* *create property Edge.out LINK* *create property Edge.in LINK* *create class Owns extends Edge* *create class Repairs extends Edge* *create vertex Person set name = 'Luca'* *create vertex Car set name = 'Ferrari Modena'* *create vertex ServiceStation set address = 'Italy'* *create index IDXX on Edge(out,in) unique* *create edge Owns from (select from Person Where name = 'Luca' ) to (select from Car where name = 'Ferrari Modena') - OK* *create edge Repairs from (select from Person Where name = 'Luca' ) to (select from ServiceStation where name = 'Italy') - OK* Now I'm adding dublicates and expecting that ORecordDuplicatedExceptio will be thrown after the second duplicated edge will be added, but what is happening is I'm getting ORecordDuplicatedExceptio when adding first edge: *create edge Owns from (select from Person Where name = 'Luca' ) to (select from Car where name = 'Ferrari Modena') - ORecordDuplicatedException has been thrown!* *create edge Repairs from (select from Person Where name = 'Luca' ) to (select from ServiceStation where name = 'Italy') - never reach this line.* Have I missed something? среда, 10 сентября 2014 г., 0:11:45 UTC+3 пользователь Lvc@ написал: > > Hi, > Create it on base class, so E in this case. > > Lvc@ > > On 9 September 2014 15:28, Max Matchenko <[email protected] <javascript:> > > wrote: > >> Hi, >> >> For the one vertex, that has two edges, we need to create composite >> unique constraint using these edges. >> >> for example we have the following: >> >> *create class V1 extends V* >> *create class V2 extends V* >> *create class V3 extends V* >> >> *...creating vertexes...* >> >> >> *create class E1 extends E* >> *create class E2 extends E* >> >> >> *create edge E1 from (select from V3) to (select from V1)* >> *create edge E2 from (select from V3) to (select from V2)* >> >> In documentation I found only how to create a unique index for a *single* >> edge. >> How can I create a single Composite Unique Constraint (Index) on multiple >> edges (E1&E2)? >> >> Thank you! >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "OrientDB" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
