Called when a relationship of this combinedType is instantiated. Please note that
a relationship can (and will) be instantiated several times during a
normal rendering turn.
169573
@Override
	public void onRelationshipInstantiation() {

		try {

			if (dbRelationship != null) {

				Node startNode = dbRelationship.getStartNode();
				Node endNode   = dbRelationship.getEndNode();

				if ((startNode != null) && (endNode != null) && startNode.hasProperty(GraphObject.id.dbName()) && endNode.hasProperty(GraphObject.id.dbName())) {

					cachedStartNodeId = (String) startNode.getProperty(GraphObject.id.dbName());
					cachedEndNodeId   = (String) endNode.getProperty(GraphObject.id.dbName());

				}

			}

		} catch (Throwable t) {
		}
	}
436409
private void join(ParserRuleContext ctx, Class<? extends Join> type)
  {
    QueryNode left = relationChain.get(relationIdx);
    QueryNode right = relationChain.get(relationIdx+1);

    try
    {
      Constructor<? extends Join> c = type.getConstructor(QueryNode.class);
      Join newJoin = c.newInstance(right);
      left.addOutgoingJoin(addParsedLocation(ctx, newJoin));
      
    }
    catch (NoSuchMethodException ex)
    {
      log.error(null, ex);
    }
    catch (InstantiationException ex)
    {
      log.error(null, ex);
    }
    catch (IllegalAccessException ex)
    {
      log.error(null, ex);
    }
    catch (InvocationTargetException ex)
    {
      log.error(null, ex);
    }

  }
209476
function UMLLink() {
        UMLUndirectedRelationship.apply(this, arguments);

        /** @member {UMLLinkEnd} */
        this.end1 = new UMLLinkEnd();
        this.end1._parent = this;

        /** @member {UMLLinkEnd} */
        this.end2 = new UMLLinkEnd();
        this.end2._parent = this;

        /** @member {UMLAssociation} */
        this.association = null;
    }
148550
public void createTypeAssociations() {
		// Connect the child to the parent rtype and interface rtypes
		ClassLoader classLoader = getClazz().getClassLoader();
		if (classLoader == null) {
			return;
		}
		ReloadableType srtype = getSuperRtype();
		if (srtype != null) {
			srtype.recordSubtype(this);
		}
		ReloadableType[] irtypes = getInterfacesRtypes();
		if (irtypes != null) {
			for (ReloadableType irtype : irtypes) {
				irtype.recordSubtype(this);
			}
		}
	}
985384
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        if (getArguments() != null) {
            images = getArguments().getStringArrayList(KEY_IMAGES);
            title = getArguments().getString(KEY_TITLE);
        }

    }
735834
@Override
	public void onViewCreated(View view, Bundle savedInstanceState) {
	
		super.onViewCreated(view, savedInstanceState);
		EventUtils.link(EVENT_CONFIGURATION);
	}
137025
protected void mergeRelationships(final Map<SpecNode, CSNodeWrapper> nodeMapping, final DataProviderFactory providerFactory) {
        final CSNodeProvider nodeProvider = providerFactory.getProvider(CSNodeProvider.class);

        for (final Map.Entry<SpecNode, CSNodeWrapper> nodes : nodeMapping.entrySet()) {
            // Only process relationship nodes
            if (!(nodes.getKey() instanceof SpecNodeWithRelationships)) continue;

            // Get the matching node and entity
            final SpecNodeWithRelationships specNode = (SpecNodeWithRelationships) nodes.getKey();
            final CSNodeWrapper entity = nodes.getValue();

            // Check if the node or entity have any relationships, if not then the node doesn't need to be merged
            if (!specNode.getRelationships().isEmpty() || entity.getRelatedToNodes() != null && !entity.getRelatedToNodes().isEmpty()) {
                // merge the relationships from the spec topic to the entity
                mergeRelationship(nodeMapping, specNode, entity, nodeProvider);
            }
        }
    }
130938
public function onBeforeDuplicate()
    {
        $owner = $this->owner;
        //loop through has_one relationships and reset any Link fields
        if($hasOne = Config::inst()->get($owner->ClassName, 'has_one')){
            foreach ($hasOne as $field => $fieldType) {
                if ($fieldType === 'Link') {
                    $owner->{$field.'ID'} = 0;
                }
            }
        }
    }
935156
private void addRelatedInstance(FunctionType constructor, JSTypeBitSet related) {
    checkArgument(constructor.hasInstanceType(),
        "Constructor %s without instance type.", constructor);
    ObjectType instanceType = constructor.getInstanceType();
    addRelatedType(instanceType, related);
  }
889251
@Override
    public void onCreate() {
        super.onCreate();

        graphMonitor = new Graph.Monitor() {
            @Override
            public void onInject(Object target) {
                if (controller != null && target == MvcService.this) {
                    controller.view = MvcService.this;
                }
            }

            @Override
            public void onRelease(Object target) {

            }
        };
        Mvc.graph().registerMonitor(graphMonitor);

        if (getControllerClass() != null) {
            try {
                controller = Mvc.graph().reference(getControllerClass(), null);
            } catch (CircularDependenciesException e) {
                e.printStackTrace();
            } catch (ProvideException e) {
                e.printStackTrace();
            } catch (ProviderMissingException e) {
                throw new IllegalStateException("Unable to inject "
                        + getControllerClass().getName() + ".\n" + e.getMessage(), e);
            }
        }

        Mvc.graph().inject(this);

        eventRegister = new EventRegister(this);
        eventRegister.registerEventBuses();
    }
477752
private void checkCallConventions(NodeTraversal t, Node n) {
    SubclassRelationship relationship =
        compiler.getCodingConvention().getClassesDefinedByCall(n);
    TypedScope scope = t.getTypedScope();
    if (relationship != null) {
      ObjectType superClass =
          TypeValidator.getInstanceOfCtor(
              scope.lookupQualifiedName(QualifiedName.of(relationship.superclassName)));
      ObjectType subClass =
          TypeValidator.getInstanceOfCtor(
              scope.lookupQualifiedName(QualifiedName.of(relationship.subclassName)));
      if (relationship.type == SubclassType.INHERITS
          && superClass != null
          && !superClass.isEmptyType()
          && subClass != null
          && !subClass.isEmptyType()) {
        validator.expectSuperType(n, superClass, subClass);
      }
    }
  }
789987
@Override
	public void onCreate(Bundle savedInstanceState) {
		
		super.onCreate(savedInstanceState);
		
		INJECTOR_CONFIGURATION = Injector.Configuration.newInstance(this);
	}
370911
function createCompoundIncludes (
  relationship,
  key,
  fk,
  type,
  includedRelations,
  options
) {
  var compoundInclude = makeRelation(type, String(relationship[key]))

  if (options && !_.isEmpty(includedRelations)) {
    var defaultModelPath = options.modelPath
    options.modelPath = type

    compoundInclude.relationships = parseRelations(
      relationship,
      includedRelations,
      options
    )

    options.modelPath = defaultModelPath
  }

  // remove the id key since its part of the base compound document, not part of attributes
  delete relationship[key]
  delete relationship[fk]

  // The rest of the data goes in the attributes
  compoundInclude.attributes = relationship

  return compoundInclude
}
358877
private void initializeEntity(Collection<? extends TypeMetadata> types, NodeState nodeState) {
        for (TypeMetadata type : types) {
            Collection<TypeMetadata> superTypes = type.getSuperTypes();
            initializeEntity(superTypes, nodeState);
            for (MethodMetadata<?, ?> methodMetadata : type.getProperties()) {
                if (methodMetadata instanceof AbstractRelationPropertyMethodMetadata) {
                    AbstractRelationPropertyMethodMetadata<?> relationPropertyMethodMetadata = (AbstractRelationPropertyMethodMetadata) methodMetadata;
                    RelationTypeMetadata<RelationshipMetadata<RemoteRelationshipType>> relationshipMetadata = relationPropertyMethodMetadata
                            .getRelationshipMetadata();
                    RemoteRelationshipType relationshipType = relationshipMetadata.getDatastoreMetadata().getDiscriminator();
                    RelationTypeMetadata.Direction direction = relationPropertyMethodMetadata.getDirection();
                    RemoteDirection remoteDirection;
                    switch (direction) {
                    case FROM:
                        remoteDirection = RemoteDirection.OUTGOING;
                        break;
                    case TO:
                        remoteDirection = RemoteDirection.INCOMING;
                        break;
                    default:
                        throw new XOException("Unsupported direction: " + direction);
                    }
                    if (nodeState.getRelationships(remoteDirection, relationshipType) == null) {
                        nodeState.setRelationships(remoteDirection, relationshipType, new StateTracker<>(new LinkedHashSet<>()));
                    }
                }
            }
        }
    }
1089295
public void populateRelationshipProperties(EntityMetadata entityMetadata, EntityMetadata targetNodeMetadata,
            Relationship relationship, Object relationshipObj)
    {
        MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                entityMetadata.getPersistenceUnit());
        EntityType entityType = metaModel.entity(relationshipObj.getClass());

        Set<Attribute> attributes = entityType.getSingularAttributes();
        for (Attribute attribute : attributes)
        {
            Field f = (Field) attribute.getJavaMember();
            if (!f.getType().equals(entityMetadata.getEntityClazz())
                    && !f.getType().equals(targetNodeMetadata.getEntityClazz()))
            {
                EntityMetadata relMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                        relationshipObj.getClass());
                String columnName = ((AbstractAttribute) attribute).getJPAColumnName();
                if (metaModel.isEmbeddable(relMetadata.getIdAttribute().getBindableJavaType())
                        && ((SingularAttribute) attribute).isId())
                {
                    // Populate Embedded attribute value into relationship
                    Object id = PropertyAccessorHelper.getId(relationshipObj, relMetadata);
                    Object serializedIdValue = serializeIdAttributeValue(relMetadata, metaModel, id);
                    relationship.setProperty(columnName, serializedIdValue);

                    // Populate attributes of embedded fields into relationship
                    Set<Attribute> embeddableAttributes = metaModel.embeddable(
                            relMetadata.getIdAttribute().getBindableJavaType()).getSingularAttributes();
                    for (Attribute embeddableAttribute : embeddableAttributes)
                    {
                        String embeddedColumn = ((AbstractAttribute) embeddableAttribute).getJPAColumnName();
                        if (embeddedColumn == null)
                            embeddedColumn = embeddableAttribute.getName();
                        Object value = PropertyAccessorHelper
                                .getObject(id, (Field) embeddableAttribute.getJavaMember());

                        if (value != null)
                            relationship.setProperty(embeddedColumn, value);
                    }
                }
                else
                {
                    Object value = PropertyAccessorHelper.getObject(relationshipObj, f);
                    relationship.setProperty(columnName, toNeo4JProperty(value));
                }

            }
        }

    }
1205634
private void addRelationshipTriples(DOReader reader,
                                        URIReference objURI,
                                        Set<Triple> set)
            throws Exception {
        for (RelationshipTuple tuple : reader.getRelationships()) {
            set.add(tuple.toTriple(null));
        }
    }
497319
function( model, attr, options ) {
			// Don't accept recursive calls to onChange (like onChange->findRelated->findOrCreate->initializeRelations->addRelated->onChange)
			if ( this.isLocked() ) {
				return;
			}
			this.acquire();
			options = this.sanitizeOptions( options );
			
			// 'options._related' is set by 'addRelated'/'removeRelated'. If it is set, the change
			// is the result of a call from a relation. If it's not, the change is the result of 
			// a 'set' call on this.instance.
			var changed = _.isUndefined( options._related );
			var oldRelated = changed ? this.related : options._related;
			
			if ( changed ) {	
				this.keyContents = attr;
				
				// Set new 'related'
				if ( attr instanceof this.relatedModel ) {
					this.related = attr;
				}
				else if ( attr ) {
					var related = this.findRelated( options );
					this.setRelated( related );
				}
				else {
					this.setRelated( null );
				}
			}
			
			// Notify old 'related' object of the terminated relation
			if ( oldRelated && this.related !== oldRelated ) {
				_.each( this.getReverseRelations( oldRelated ), function( relation ) {
						relation.removeRelated( this.instance, options );
					}, this );
			}
			
			// Notify new 'related' object of the new relation. Note we do re-apply even if this.related is oldRelated;
			// that can be necessary for bi-directional relations if 'this.instance' was created after 'this.related'.
			// In that case, 'this.instance' will already know 'this.related', but the reverse might not exist yet.
			_.each( this.getReverseRelations(), function( relation ) {
					relation.addRelated( this.instance, options );
				}, this);
			
			// Fire the 'update:<key>' event if 'related' was updated
			if ( !options.silentChange && this.related !== oldRelated ) {
				var dit = this;
				Backbone.Relational.eventQueue.add( function() {
					dit.instance.trigger( 'update:' + dit.key, dit.instance, dit.related, options );
				});
			}
			this.release();
		}