}
}
@Override
public Association getAssociation(AssociationKey key, AssociationContext associationContext) {
AssociationStorageStrategy storageStrategy = getAssociationStorageStrategy( key, associationContext );
// We need to execute the previous operations first or it won't be able to find the key that should have
// been created
executeBatch( associationContext.getOperationsQueue() );
if ( storageStrategy.isEmbeddedInEntity() ) {
DBObject entity = getObjectAsEmbeddedAssociation( key );
if ( getAssociationFieldOrNull( key, entity ) != null ) {
return new Association( new MongoDBAssociationSnapshot( entity, key, storageStrategy ) );
}
else {