if ( owningEntity != null && owningEntity.getProperties().containsKey( key.getMetadata().getCollectionRole() ) ) {
couchDBAssociation = CouchDBAssociation.fromEmbeddedAssociation( owningEntity, key.getMetadata().getCollectionRole() );
}
}
else {
AssociationDocument association = getDataStore().getAssociation( Identifier.createAssociationId( key ) );
if ( association != null ) {
couchDBAssociation = CouchDBAssociation.fromAssociationDocument( association );
}
}