- return entity.addRelationshipToName(toName, type, null, null, null);
+ NameRelationship rel;
+ if (inverse){
+ rel = entity.addRelationshipFromName(relatedName, (NameRelationshipType)type, null, null, null, null);
+ }else{
+ rel = entity.addRelationshipToName(relatedName, (NameRelationshipType)type, null, null, null, null);
+ }
+ return rel;