get a Collection of Keys of already existing m:n rows

@param cod
@param obj
@return Collection of Key
174899
public List getMtoNImplementor(CollectionDescriptor cod, Object obj)
    {
        ResultSetAndStatement rs = null;
        ArrayList result = new ArrayList();
        ClassDescriptor cld = pb.getDescriptorRepository().getDescriptorFor(obj.getClass());
        ValueContainer[] pkValues = pb.serviceBrokerHelper().getKeyValues(cld, obj);
        String[] pkColumns = cod.getFksToThisClass();
        String[] fkColumns = cod.getFksToItemClass();
        String table = cod.getIndirectionTable();

        String selectStmt = pb.serviceSqlGenerator().getSelectMNStatement(table, fkColumns, pkColumns);

        ClassDescriptor itemCLD = pb.getDescriptorRepository().getDescriptorFor(cod.getItemClass());
        Collection extents = pb.getDescriptorRepository().getAllConcreteSubclassDescriptors(itemCLD);
        if(extents.size() > 0)
        {
            itemCLD = (ClassDescriptor) extents.iterator().next();
        }
        FieldDescriptor[] itemClassPKFields = itemCLD.getPkFields();
        if(itemClassPKFields.length != fkColumns.length)
        {
            throw new PersistenceBrokerException("All pk fields of the element-class need to" +
                    " be declared in the indirection table. Element class is "
                    + itemCLD.getClassNameOfObject() + " with " + itemClassPKFields.length + " pk-fields." +
                    " Declared 'fk-pointing-to-element-class' elements in collection-descriptor are"
                    + fkColumns.length);
        }
        try
        {
            rs = pb.serviceJdbcAccess().executeSQL(selectStmt, cld, pkValues, Query.NOT_SCROLLABLE);
            while(rs.m_rs.next())
            {
                ValueContainer[] row = new ValueContainer[fkColumns.length];
                for(int i = 0; i < row.length; i++)
                {
                    row[i] = new ValueContainer(rs.m_rs.getObject(i + 1), itemClassPKFields[i].getJdbcType());
                }
                result.add(new MtoNBroker.Key(row));
            }
        }
        catch(PersistenceBrokerException e)
        {
            throw e;
        }
        catch(SQLException e)
        {
            throw new PersistenceBrokerSQLException(e);
        }
        finally
        {
            if(rs != null) rs.close();
        }
        return result;
    }
842453
@SuppressWarnings("unchecked")
    public Collection<String> getPropertyKeys(Object obj) {
        if (isArray(obj)) {
          throw new UnsupportedOperationException();
        } else {
            return ((Map) obj).keySet();
        }
    }
262540
function getObjectWithStringifiedKeys(object) {
	return Object.keys(object).reduce((objectJSON, key) => {
		objectJSON[key] = String(object[key]);

		return objectJSON;
	}, {});
}
307089
protected ValueContainer[] getKeyValues(PersistenceBroker broker, ClassDescriptor cld, Object obj) throws PersistenceBrokerException
    {
        return broker.serviceBrokerHelper().getKeyValues(cld, obj);
    }
368850
@SuppressWarnings("unchecked")
    public Iterator<K> keys()
    {
        int size = _size;

        if (size == 0)
        {
            return null;
        }
        ArrayList<K> keyList = new ArrayList<K>();
        int i = (size - 1) * 2;
        while (i >= 0)
        {
            keyList.add((K) _array[i]);
            i = i - 2;
        }
        return keyList.iterator();
    }
1309642
private <K, V> List<Map.Entry<K, V>> sortedEntryList(Map<K, V> obj) {
        List<Map.Entry<K, V>> entryList = new ArrayList<Map.Entry<K, V>>(obj.entrySet());

        Collections.sort(entryList, new Comparator<Map.Entry<K, V>>() {
            @Override
            @SuppressWarnings({ "unchecked", "rawtypes" })
            public int compare(Entry<K, V> o1, Entry<K, V> o2) {
                K k1 = o1.getKey();
                K k2 = o2.getKey();

                if (k1 instanceof Comparable) {
                    return ((Comparable) k1).compareTo(k2);
                }

                return k1.hashCode() - k2.hashCode();
            }
        });

        return entryList;
    }
646639
public static <K, V> ImmutableListMultimap<K, V> indexToListMultimapWithMultipleKeys(
      Iterable<? extends V> values, Function<? super V, ? extends Collection<? extends K>> keyFunction) {
    final ImmutableListMultimap.Builder<K,V> ret = ImmutableListMultimap.builder();

    for (final V value : values) {
      // nulls banned by contract
      //noinspection ConstantConditions
      for (K key : keyFunction.apply(value)) {
        ret.put(key, value);
      }
    }

    return ret.build();
  }
1254545
function entries(obj) {
    return Object.keys(obj)
        .map(key => [key, obj[key]]);
}
878009
private void storeCollections(Object obj, ClassDescriptor cld, boolean insert) throws PersistenceBrokerException
    {
        // get all members of obj that are collections and store all their elements
        Collection listCods = cld.getCollectionDescriptors();
        // return if nothing to do
        if (listCods.size() == 0)
        {
            return;
        }
        Iterator i = listCods.iterator();
        while (i.hasNext())
        {
            CollectionDescriptor cod = (CollectionDescriptor) i.next();

            // if CASCADE_NONE was set, do nothing with referenced objects
            if (cod.getCascadingStore() != ObjectReferenceDescriptor.CASCADE_NONE)
            {
                Object referencedObjects = cod.getPersistentField().get(obj);
                if (cod.isMtoNRelation())
                {
                    storeAndLinkMtoN(false, obj, cod, referencedObjects, insert);
                }
                else
                {
                    storeAndLinkOneToMany(false, obj, cod, referencedObjects, insert);
                }

                // BRJ: only when auto-update = object (CASCADE_OBJECT)
                //
                if ((cod.getCascadingStore() == ObjectReferenceDescriptor.CASCADE_OBJECT)
                        && (referencedObjects instanceof ManageableCollection))
                {
                    ((ManageableCollection) referencedObjects).afterStore(this);
                }
            }
        }
    }
390918
function iterateOverKeys(getFn, obj, fn, hidden) {
  var keys = getFn(obj), desc;
  for (var i = 0, key; key = keys[i]; i++) {
    desc = getOwnPropertyDescriptor(obj, key);
    if (desc.enumerable || hidden) {
      fn(obj[key], key);
    }
  }
}
16589
public void deleteMtoNImplementor(CollectionDescriptor cod, Object obj, Iterator collectionIterator, Collection mnKeys)
    {
        if(mnKeys.isEmpty() || collectionIterator == null)
        {
            return;
        }
        List workList = new ArrayList(mnKeys);
        MtoNBroker.Key relatedObjKeys;
        ClassDescriptor relatedCld = pb.getDescriptorRepository().getDescriptorFor(cod.getItemClass());
        Object relatedObj;

        // remove keys of relatedObject from the existing m:n rows in workList
        while(collectionIterator.hasNext())
        {
            relatedObj = collectionIterator.next();
            relatedObjKeys = new MtoNBroker.Key(pb.serviceBrokerHelper().getKeyValues(relatedCld, relatedObj, true));
            workList.remove(relatedObjKeys);
        }

        // delete all remaining keys in workList
        ClassDescriptor cld = pb.getDescriptorRepository().getDescriptorFor(obj.getClass());
        ValueContainer[] pkValues = pb.serviceBrokerHelper().getKeyValues(cld, obj);

        String[] pkColumns = cod.getFksToThisClass();
        String[] fkColumns = cod.getFksToItemClass();
        String table = cod.getIndirectionTable();
        String deleteStmt;

        ValueContainer[] fkValues;
        Iterator iter = workList.iterator();
        while(iter.hasNext())
        {
            fkValues = ((MtoNBroker.Key) iter.next()).m_containers;
            deleteStmt = pb.serviceSqlGenerator().getDeleteMNStatement(table, pkColumns, fkColumns);
            pb.serviceJdbcAccess().executeUpdateSQL(deleteStmt, cld, pkValues, fkValues);
        }
    }
169473
private Map<String, Object> convertObject(V8Object obj) {
		if (obj.isUndefined()) {
			return null;
		}
		Map<String, Object> r = new LinkedHashMap<>();
		for (String k : obj.getKeys()) {
			Object o = obj.get(k);
			if (o instanceof V8Array) {
				o = convert((V8Array)o, List.class);
			} else if (o instanceof V8Object) {
				o = convert((V8Object)o, Map.class);
			}
			r.put(k, o);
		}
		return r;
	}
909023
private List<Data> getKeyValueSequence(Map<?, ?> entries) {
        if (entries == null || entries.isEmpty()) {
            return Collections.emptyList();
        }
        List<Data> keyValueSequence = new ArrayList<>(entries.size() * 2);
        for (Map.Entry<?, ?> entry : entries.entrySet()) {
            Object key = entry.getKey();
            Object value = entry.getValue();
            Data dataKey = mapServiceContext.toData(key);
            Data dataValue = mapServiceContext.toData(value);
            keyValueSequence.add(dataKey);
            keyValueSequence.add(dataValue);
        }
        return keyValueSequence;
    }
290433
public <K> Map<K, String> getMulti(Serializer<K> keySerializer, K... keys) {
    MultigetSliceQuery<K, String,String> q = createMultigetSliceQuery(keyspace, keySerializer, serializer, serializer);
    q.setColumnFamily(CF_NAME);
    q.setKeys(keys);
    q.setColumnNames(COLUMN_NAME);

    QueryResult<Rows<K, String,String>> r = q.execute();
    Rows<K, String,String> rows = r.get();
    Map<K, String> ret = new HashMap<K, String>(keys.length);
    for (K k: keys) {
      HColumn<String,String> c = rows.getByKey(k).getColumnSlice().getColumnByName(COLUMN_NAME);
      if (c != null && c.getValue() != null) {
        ret.put(k, c.getValue());
      }
    }
    return ret;
  }
1178195
def getobjects(bunchdt, data, commdct, key, places=7, **kwargs):
    """"""
    idfobjects = bunchdt[key]
    allobjs = []
    for obj in idfobjects:
        if __objecthasfields(
                bunchdt, data, commdct,
                obj, places=places, **kwargs):
            allobjs.append(obj)
    return allobjs
123115
function allKeys(obj) {
        if (!isObject(obj)) return [];
        var keys = [];
        for (var key in obj) keys.push(key);
        return keys;
    }
412080
function objectKeys(object) {
  if (Object.keys) {
    return Object.keys(object);
  }
  var result = [];

  angular.forEach(object, function(val, key) {
    result.push(key);
  });
  return result;
}