Dictionary mapping each entity class to configure a loader for to a
        list of (possibly nested) entity attribute names.

def loader_options(self):
        """
        Dictionary mapping each entity class to configure a loader for to a
        list of (possibly nested) entity attribute names.
        """
        all_keys = set(self.__attr_map.keys())
        # Go through the collected keys and through out all keys which are
        # subkeys of others to eliminate redundancy.
        for key in sorted(self.__attr_map):
            for idx in range(1, len(key)):
                sub_key = key[:-idx]
                if sub_key in all_keys:
                    all_keys.remove(sub_key)
        if provides_member_resource(self._context):
            # If the context is a member, we need to configure the loaders
            # for the entity class belonging to each of its resource
            # attributes. Only nested keys collected from the representer
            # configuration need to be configured (and the corresponding
            # nested entity attribute needs to be shortened).
            loader_option_map = defaultdict(list)
            for key in all_keys:
                entity_attr_names = self.__attr_map[key]
                if len(entity_attr_names) > 1:
                    ent_attr_name = entity_attr_names[0]
                    nested_attr_name = '.'.join(entity_attr_names[1:])
                    opts = loader_option_map[ent_attr_name]
                    opts.append(nested_attr_name)
            # Translate to entity classes as keys. This is tricky as the
            # keys in the loader option map can itself be nested attributes.
            for ent_attr_name, nested_attr_names in loader_option_map.items():
                ent_attr_name_tokens = ent_attr_name.split('.')
                ent_cls = get_entity_class(self._context)
                ent_cls_attr = getattr(ent_cls, ent_attr_name_tokens[0])
                ent_cls = ent_cls_attr.property.mapper.entity
                if len(ent_attr_name_tokens) > 1:
                    prefix = '.'.join(ent_attr_name_tokens[1:])
                    loader_option_map[ent_cls] = \
                            ["%s.%s" % (prefix, token)
                             for token in nested_attr_names]
                else:
                    loader_option_map[ent_cls] = nested_attr_names
                del loader_option_map[ent_attr_name]
        else:
            # If the context is a collection, we need to configure the
            # loader for its entity class.
            loader_option_map = {get_entity_class(self._context) :
                                 ['.'.join(self.__attr_map[key])
                                  for key in all_keys]}
        return loader_option_map