code: public static void populateCompoundKey(DBObject dbObj, EntityMetadata m, MetamodelImpl metaModel, Object id)
      {
          EmbeddableType compoundKey = metaModel.embeddable(m.getIdAttribute().getBindableJavaType());
          // Iterator<Attribute> iter = compoundKey.getAttributes().iterator();
          BasicDBObject compoundKeyObj = new BasicDBObject();
  
          compoundKeyObj = getCompoundKeyColumns(m, id, compoundKey, metaModel);
  
          dbObj.put("_id", compoundKeyObj);
      }
docs: Populate compound key.
  
  @param dbObj
  the db obj
  @param m
  the m
  @param metaModel
  the meta model
  @param id
  the id