Return all the entities in the group.

        Because groups can contain both individual entities, as well
        as whole groups of entities, this method acts as a convenient
        way to get a queryset of all the entities in the group.
162728
def all_entities(self, is_active=True):
        
        return self.get_all_entities(return_models=True, is_active=is_active)
1012534
private Iterator<IEntityGroup> getMemberGroups() throws GroupsException {

        Set<IEntityGroup> rslt = new HashSet<>();
        for (IGroupMember child : getChildren()) {
            if (child.isGroup()) {
                rslt.add((IEntityGroup) child);
            }
        }

        return rslt.iterator();
    }
700781
def get_queryset(self, *args, **kwargs):
        
        qs = super(AutoPrefetchMixin, self).get_queryset(*args, **kwargs)
        included_resources = get_included_resources(self.request)

        for included in included_resources:
            included_model = None
            levels = included.split('.')
            level_model = qs.model
            for level in levels:
                if not hasattr(level_model, level):
                    break
                field = getattr(level_model, level)
                field_class = field.__class__

                is_forward_relation = (
                    issubclass(field_class, ForwardManyToOneDescriptor) or
                    issubclass(field_class, ManyToManyDescriptor)
                )
                is_reverse_relation = (
                    issubclass(field_class, ReverseManyToOneDescriptor) or
                    issubclass(field_class, ReverseOneToOneDescriptor)
                )
                if not (is_forward_relation or is_reverse_relation):
                    break

                if level == levels[-1]:
                    included_model = field
                else:

                    if issubclass(field_class, ReverseOneToOneDescriptor):
                        model_field = field.related.field
                    else:
                        model_field = field.field

                    if is_forward_relation:
                        level_model = model_field.related_model
                    else:
                        level_model = model_field.model

            if included_model is not None:
                qs = qs.prefetch_related(included.replace('.', '__'))

        return qs
276982
def groupQuery( self ):
        
        items = self.uiQueryTREE.selectedItems()
        if ( not len(items) > 2 ):
            return
        
        if ( isinstance(items[-1], XJoinItem) ):
            items = items[:-1]
        
        tree   = self.uiQueryTREE
        parent = items[0].parent()
        if ( not parent ):
            parent = tree
        
        preceeding = items[-1]
        
        tree.blockSignals(True)
        tree.setUpdatesEnabled(False)
        
        grp_item = XQueryItem(parent, Q(), preceeding = preceeding)
        for item in items:
            parent = item.parent()
            if ( not parent ):
                tree.takeTopLevelItem(tree.indexOfTopLevelItem(item))
            else:
                parent.takeChild(parent.indexOfChild(item))
            grp_item.addChild(item)
        grp_item.update()
        
        tree.blockSignals(False)
        tree.setUpdatesEnabled(True)
441358
def data_groups(self, groups, entity_count):
        
        data = []
        # process group objects
        for xid in groups.keys():
            # get association from group data
            assoc_group_data = self.data_group_association(xid)
            data += assoc_group_data
            entity_count += len(assoc_group_data)

            if entity_count >= self._batch_max_chunk:
                break
        return data, entity_count
479617
def get_instances(self):
        
        services = []
        for resource in self._get_instances():
            services.append(resource['entity']['name'])

        return services
592616
def _filter_queryset(self, queryset):
        
        entities = self.request.query_params.getlist('entity')
        labels = self.request.query_params.getlist('label')
        positions = self.request.query_params.getlist('position')

        if labels and len(labels) != len(entities):
            raise exceptions.ParseError(
                'If `labels` query parameter is given, also `entities` '
                'must be given and they must be of the same length.'
            )

        if positions and len(positions) != len(entities):
            raise exceptions.ParseError(
                'If `positions` query parameter is given, also `entities` '
                'must be given and they must be of the same length.'
            )

        if entities:
            for entity, label, position in zip_longest(entities, labels, positions):
                filter_params = {'entities__pk': entity}
                if label:
                    filter_params['relationpartition__label'] = label
                if position:
                    filter_params['relationpartition__position'] = position

                queryset = queryset.filter(**filter_params)

        return queryset
1070233
public Map<String, Object> all(String entityName, String groupId) throws MnoException {
		return all(entityName, groupId, null, getAuthenticatedClient());
	}
1096467
def get_descendants_group_count(cls, parent=None):
        

        #~
        # disclaimer: this is the FOURTH implementation I wrote for this
        # function. I really tried to make it return a queryset, but doing so
        # with a *single* query isn't trivial with Django's ORM.

        # ok, I DID manage to make Django's ORM return a queryset here,
        # defining two querysets, passing one subquery in the tables parameters
        # of .extra() of the second queryset, using the undocumented order_by
        # feature, and using a HORRIBLE hack to avoid django quoting the
        # subquery as a table, BUT (and there is always a but) the hack didn't
        # survive turning the QuerySet into a ValuesQuerySet, so I just used
        # good old SQL.
        # NOTE: in case there is interest, the hack to avoid django quoting the
        # subquery as a table, was adding the subquery to the alias cache of
        # the queryset's query object:
        #
        #     qset.query.quote_cache[subquery] = subquery
        #
        # If there is a better way to do this in an UNMODIFIED django 1.0, let
        # me know.
        #~

        cls = get_result_class(cls)
        vendor = cls.get_database_vendor('write')

        if parent:
            depth = parent.depth + 1
            params = cls._get_children_path_interval(parent.path)
            extrand = 'AND path BETWEEN %s AND %s'
        else:
            depth = 1
            params = []
            extrand = ''

        subpath = sql_substr("path", "1", "%(subpathlen)s", vendor=vendor)

        sql = (
            'SELECT * FROM %(table)s AS t1 INNER JOIN '
            ' (SELECT '
            '   ' + subpath + ' AS subpath, '
            '   COUNT(1)-1 AS count '
            '   FROM %(table)s '
            '   WHERE depth >= %(depth)s %(extrand)s'
            '   GROUP BY '+ subpath + ') AS t2 '
            ' ON t1.path=t2.subpath '
            ' ORDER BY t1.path'
        ) % {
            'table': connection.ops.quote_name(cls._meta.db_table),
            'subpathlen': depth * cls.steplen,
            'depth': depth,
                'extrand': extrand}
        cursor = cls._get_database_cursor('write')
        cursor.execute(sql, params)

        ret = []
        field_names = [field[0] for field in cursor.description]
        for node_data in cursor.fetchall():
            node = cls(**dict(zip(field_names, node_data[:-2])))
            node.descendants_count = node_data[-1]
            ret.append(node)
        return ret
637486
def entities(self):
        
        if self._entities is None:
            self._entities = EntityList(self._version, service_sid=self._solution['sid'], )
        return self._entities
1117282
def list(self, entity=None):
        
        uri = "/%s" % self.uri_base
        if entity:
            uri = "%s?entityId=%s" % (uri, utils.get_id(entity))
        resp, resp_body = self._list(uri, return_raw=True)
        return resp_body
720225
public List<QueryType<EntityBeanType<T>>> getAllQuery()
   {
      List<QueryType<EntityBeanType<T>>> list = new ArrayList<QueryType<EntityBeanType<T>>>();
      List<Node> nodeList = childNode.get("query");
      for(Node node: nodeList)
      {
         QueryType<EntityBeanType<T>>  type = new QueryTypeImpl<EntityBeanType<T>>(this, "query", childNode, node);
         list.add(type);
      }
      return list;
   }
106783
public GroupResources groupResources() {
        if (groups.get() == null) {
            groups.compareAndSet(null, new GroupResourcesImpl(this));
        }
        return groups.get();
    }
263100
private Set<String> getGroups(DirContext context, String callerDn) {
        Set<String> groups = null;
        String groupSearchBase = idStoreDefinition.getGroupSearchBase();
        String groupSearchFilter = idStoreDefinition.getGroupSearchFilter();
        if (groupSearchBase.isEmpty() || groupSearchFilter.isEmpty()) {
            groups = getGroupsByMembership(context, callerDn);
        } else {
            groups = getGroupsByMember(context, callerDn, groupSearchBase, groupSearchFilter);
        }
        return groups;
    }
640643
def group(self):
        
        retval = None
        parent = self.get_parent()
        Group = get_group_model()
        if issubclass(parent.specific_class, Group):
            retval = parent.specific
        if retval is None:
            retval = self.group_page
        return retval
305336
List getGroupby()
    {
        List result = _getGroupby();
        Iterator iter = getCriteria().iterator();
        Object crit;

        while (iter.hasNext())
        {
            crit = iter.next();
            if (crit instanceof Criteria)
            {
                result.addAll(((Criteria) crit).getGroupby());
            }
        }

        return result;
    }
1161093
private List<Field> getAllFields() {
    List<Field> allFields = new ArrayList<>();
    Class<?> clazz = entityClass;
    boolean stop;
    do {
      List<Field> fields = IntrospectionUtils.getPersistableFields(clazz);
      allFields.addAll(fields);
      clazz = clazz.getSuperclass();
      stop = clazz == null || !clazz.isAnnotationPresent(MappedSuperClass.class);
    } while (!stop);
    return allFields;
  }