private Relationship createRelationship(AssociationKey associationKey, Tuple associationRow, AssociatedEntityKeyMetadata associatedEntityKeyMetadata, AssociationContext associationContext) {
		switch ( associationKey.getMetadata().getAssociationKind() ) {
			case EMBEDDED_COLLECTION:
				return createRelationshipWithEmbeddedNode( associationKey, associationRow, associatedEntityKeyMetadata );
			case ASSOCIATION:
				return findOrCreateRelationshipWithEntityNode( associationKey, associationRow, associatedEntityKeyMetadata, associationContext.getTupleTypeContext() );
			default:
				throw new AssertionFailure( "Unrecognized associationKind: " + associationKey.getMetadata().getAssociationKind() );
		}
	}
private Relationship createRelationship ( AssociationKey associationKey , Tuple associationRow , AssociatedEntityKeyMetadata associatedEntityKeyMetadata , AssociationContext associationContext ) { switch ( associationKey . getMetadata ( ) . getAssociationKind ( ) ) { case EMBEDDED_COLLECTION : return createRelationshipWithEmbeddedNode ( associationKey , associationRow , associatedEntityKeyMetadata ) ; case ASSOCIATION : return findOrCreateRelationshipWithEntityNode ( associationKey , associationRow , associatedEntityKeyMetadata , associationContext . getTupleTypeContext ( ) ) ; default : throw new AssertionFailure ( "Unrecognized associationKind: " + associationKey . getMetadata ( ) . getAssociationKind ( ) ) ; } }
When dealing with some scenarios like, for example, a bidirectional association, OGM calls this method twice:
<p>
the first time with the information related to the owner of the association and the {@link RowKey},
the second time using the same {@link RowKey} but with the {@link AssociationKey} referring to the other side of the association.
@param associatedEntityKeyMetadata
@param associationContext