Refactor getAssociationCriteriaDiscriminator.