久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

  • <i id='hDQwI'><tr id='hDQwI'><dt id='hDQwI'><q id='hDQwI'><span id='hDQwI'><b id='hDQwI'><form id='hDQwI'><ins id='hDQwI'></ins><ul id='hDQwI'></ul><sub id='hDQwI'></sub></form><legend id='hDQwI'></legend><bdo id='hDQwI'><pre id='hDQwI'><center id='hDQwI'></center></pre></bdo></b><th id='hDQwI'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='hDQwI'><tfoot id='hDQwI'></tfoot><dl id='hDQwI'><fieldset id='hDQwI'></fieldset></dl></div>
  • <small id='hDQwI'></small><noframes id='hDQwI'>

      • <bdo id='hDQwI'></bdo><ul id='hDQwI'></ul>
      <legend id='hDQwI'><style id='hDQwI'><dir id='hDQwI'><q id='hDQwI'></q></dir></style></legend>

      1. <tfoot id='hDQwI'></tfoot>

        DynamoDB 列表類型

        DynamoDB List type(DynamoDB 列表類型)
          <bdo id='awBZ3'></bdo><ul id='awBZ3'></ul>
            <tbody id='awBZ3'></tbody>
        • <tfoot id='awBZ3'></tfoot>

          <legend id='awBZ3'><style id='awBZ3'><dir id='awBZ3'><q id='awBZ3'></q></dir></style></legend>

              1. <i id='awBZ3'><tr id='awBZ3'><dt id='awBZ3'><q id='awBZ3'><span id='awBZ3'><b id='awBZ3'><form id='awBZ3'><ins id='awBZ3'></ins><ul id='awBZ3'></ul><sub id='awBZ3'></sub></form><legend id='awBZ3'></legend><bdo id='awBZ3'><pre id='awBZ3'><center id='awBZ3'></center></pre></bdo></b><th id='awBZ3'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='awBZ3'><tfoot id='awBZ3'></tfoot><dl id='awBZ3'><fieldset id='awBZ3'></fieldset></dl></div>

                • <small id='awBZ3'></small><noframes id='awBZ3'>

                  本文介紹了DynamoDB 列表類型的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學(xué)習(xí)吧!

                  問題描述

                  I have problems understanding how to create a List for dynamoDB from my Android app. I can store and load the { "deviceId": "920e185a-63ed-46ca-bfca-f7a484ccb708" } from my app. But then to add the List and store my JSON objects as Map in the List is were i struggle.

                  The dynamoDB structure I want to create and populate looks like this in a JSON format:

                  { "data": [ { "heartBeatId": 1, "status": 1, "timeStamp": 1502183502711 }, { "heartBeatId": 2, "status": 1, "timeStamp": 1502183502812 } ], "deviceId": "90563daa-63ae-40c5-905e-9e8c02f9624f" } Then I want to populate the data List with the heartbeat object which is of Map type. { "heartBeatId": 2, "status": 1, "timeStamp": 1502183502812 } So im having problems defining the @DynamoDBTable(tableName = "heartbeat") class to create this structure.

                  I have been reading about the List and DynamoDBDocument here:

                  DynamoDBDocument

                  DataType List

                  This how the @DynamoDBTable(tableName = "heartbeat") class looks right now.

                  I hope someone can help me define it or give me clues on how to proceed getting the structure i need.

                  package com.example.android.awsdynamoapp;
                  
                  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBAttribute;
                  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBDocument;
                  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBHashKey;
                  import com.amazonaws.mobileconnectors.dynamodbv2.dynamodbmapper.DynamoDBTable;
                  
                  import java.lang.annotation.Annotation;
                  import java.util.HashMap;
                  import java.util.List;
                  import java.util.Map;
                  
                  @DynamoDBTable(tableName = "heartbeat")
                  public class HeartBeat implements DynamoDBTable {
                  
                  private String deviceId;
                  private Map<String, Integer> data;
                  private List dataList;
                  
                  public HeartBeat(){};
                  public HeartBeat(String deviceId){this.deviceId = deviceId;};
                  
                  public HeartBeat(String deviceId, List dataList) {
                      this.deviceId = deviceId;
                      this.dataList = dataList;
                    //  this.timeStamp = timeStamp;
                  }
                  
                  @DynamoDBHashKey(attributeName = "deviceId")
                  public String getDeviceId() {
                      return deviceId;
                  }
                  
                  public void setDeviceId(String deviceId) {
                      this.deviceId = deviceId;
                  }
                  public void setTimeStamp(String timeStamp) {
                      //this.timeStamp = timeStamp;
                  }
                  
                  
                  public void setData(String deviceId) {
                      Map<String, Integer> data = new HashMap<>();
                  
                  }
                  
                  @DynamoDBAttribute(attributeName = "data")
                  public List getData() {
                      return this.dataList;
                  }
                  
                  @DynamoDBDocument
                  public static class JsonArray {
                      private String heartBeatId;
                      private String status;
                      private String timeStamp;
                  
                  }
                  
                  /**
                   * The name of the table to use for this class.
                   */
                  @Override
                  public String tableName() {
                      return "heartbeat";
                  }
                  
                  @Override
                  public Class<? extends Annotation> annotationType() {
                      return null;
                  }
                  }
                  

                  解決方案

                  The list of map object can be created as follows. The good thing in the above structure is that all the attributes in data is a Number. You can change it to String if needed as well. Based on your expected output, I have defined it as Long.

                  Attribute Definition:-

                  private List<Map<String, Long>> data;
                  
                  @DynamoDBAttribute(attributeName = "data")  
                  public List<Map<String, Long>> getData() {
                      return data;
                  }
                  
                  public void setData(List<Map<String, Long>> data) {
                      this.data = data;
                  }
                  

                  Populate the data:-

                      MoviesWithData movies = new MoviesWithData();
                      movies.setYearKey(1917);
                      movies.setTitle("Tilte with list of map");
                  
                      Map<String, Long> dataMap1 = new HashMap<>();
                      dataMap1.put("heartBeatId", 1L);
                      dataMap1.put("status", 1L);
                      dataMap1.put("timeStamp", 1502183502812L);
                  
                      Map<String, Long> dataMap2 = new HashMap<>();
                      dataMap2.put("heartBeatId", 2L);
                      dataMap2.put("status", 2L);
                      dataMap2.put("timeStamp", 1503183502812L);
                  
                      movies.setData(Arrays.asList(dataMap1, dataMap2));
                      dynamoDBMapper.save(movies, consistentDynamoDBMapperConfig);
                  

                  Sample output:-

                  這篇關(guān)于DynamoDB 列表類型的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

                  【網(wǎng)站聲明】本站部分內(nèi)容來源于互聯(lián)網(wǎng),旨在幫助大家更快的解決問題,如果有圖片或者內(nèi)容侵犯了您的權(quán)益,請聯(lián)系我們刪除處理,感謝您的支持!

                  相關(guān)文檔推薦

                  Get user#39;s current location using GPS(使用 GPS 獲取用戶的當(dāng)前位置)
                  IllegalArgumentException thrown by requestLocationUpdate()(requestLocationUpdate() 拋出的 IllegalArgumentException)
                  How reliable is LocationManager#39;s getLastKnownLocation and how often is it updated?(LocationManager 的 getLastKnownLocation 有多可靠,多久更新一次?)
                  How to detect Location Provider ? GPS or Network Provider(如何檢測位置提供者?GPS 或網(wǎng)絡(luò)提供商)
                  Get current location during app launch(在應(yīng)用啟動期間獲取當(dāng)前位置)
                  locationManager.getLastKnownLocation() return null(locationManager.getLastKnownLocation() 返回 null)
                  1. <legend id='5nJqM'><style id='5nJqM'><dir id='5nJqM'><q id='5nJqM'></q></dir></style></legend>
                    <i id='5nJqM'><tr id='5nJqM'><dt id='5nJqM'><q id='5nJqM'><span id='5nJqM'><b id='5nJqM'><form id='5nJqM'><ins id='5nJqM'></ins><ul id='5nJqM'></ul><sub id='5nJqM'></sub></form><legend id='5nJqM'></legend><bdo id='5nJqM'><pre id='5nJqM'><center id='5nJqM'></center></pre></bdo></b><th id='5nJqM'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='5nJqM'><tfoot id='5nJqM'></tfoot><dl id='5nJqM'><fieldset id='5nJqM'></fieldset></dl></div>

                    <small id='5nJqM'></small><noframes id='5nJqM'>

                          <tbody id='5nJqM'></tbody>
                        • <bdo id='5nJqM'></bdo><ul id='5nJqM'></ul>
                        • <tfoot id='5nJqM'></tfoot>

                            主站蜘蛛池模板: 国产精品高潮呻吟久久av黑人 | 超碰97人人人人人蜜桃 | 超碰天天 | 国产极品91| 久热电影 | 亚洲国产一区二区三区在线观看 | 曰韩三级 | 天天天天操 | 国产成人免费视频 | 欧美色999| 欧美成人一区二区三区 | 大象一区 | 国产精品国产精品国产专区不卡 | 国产成人精品一区二 | 亚洲成人精品 | 久久国产三级 | 污片在线观看 | 中文字幕在线一区二区三区 | 第一色在线 | 亚洲自拍偷拍视频 | 成人久久网 | 国产三级一区二区三区 | 国产黄色大片 | 国产精品视频免费看 | 久久99精品久久久久 | 国产精品一区二区三区四区 | 四虎影视1304t | 日韩免费高清视频 | 国产三区四区 | 国产欧美一级二级三级在线视频 | 午夜天堂精品久久久久 | 精精国产xxxx视频在线播放 | 91一区二区 | 欧美一区二区三区在线看 | 亚洲精品1区 | av性色全交蜜桃成熟时 | 欧美午夜一区二区三区免费大片 | 欧美另类视频 | 亚洲精品视频二区 | 日韩精品在线网站 | 四季久久免费一区二区三区四区 |