'Returns a user\'s annotation object for an item.'

def get_item_annotation_obj(self, db_session, user, item):

    annotation_assoc_class = self._get_annotation_assoc_class(item)
    if (not annotation_assoc_class):
        return None
    annotation_assoc = db_session.query(annotation_assoc_class).filter_by(user=user)
    if (item.__class__ == galaxy.model.History):
        annotation_assoc = annotation_assoc.filter_by(history=item)
    elif (item.__class__ == galaxy.model.HistoryDatasetAssociation):
        annotation_assoc = annotation_assoc.filter_by(hda=item)
    elif (item.__class__ == galaxy.model.StoredWorkflow):
        annotation_assoc = annotation_assoc.filter_by(stored_workflow=item)
    elif (item.__class__ == galaxy.model.WorkflowStep):
        annotation_assoc = annotation_assoc.filter_by(workflow_step=item)
    elif (item.__class__ == galaxy.model.Page):
        annotation_assoc = annotation_assoc.filter_by(page=item)
    elif (item.__class__ == galaxy.model.Visualization):
        annotation_assoc = annotation_assoc.filter_by(visualization=item)
    return annotation_assoc.first()
