'Get the alias of the component that represents the parent
node in a hierarchy (for link-table based hierarchies)
@param tablename: the table name
@returns: the alias of the hierarchy parent component'

@classmethod
def hierarchy_link(cls, tablename):

    if (not cls.table(tablename, db_only=True)):
        return None
    hierarchy_link = cls.get_config(tablename, 'hierarchy_link')
    if (not hierarchy_link):
        hierarchy = cls.get_config(tablename, 'hierarchy')
        if (hierarchy and ('.' in hierarchy)):
            alias = hierarchy.rsplit('.', 1)[0]
            if ('__link' in alias):
                hierarchy_link = alias.rsplit('__link', 1)[0]
    return hierarchy_link
