Azure SDK for Java - 更新表实体会添加名称以 odata 开头的字段

问题描述 投票:0回答:0

我正在使用 Azure SDK for Java 并使用 Azure 存储表。 我正在尝试连续更新字段,我使用的代码如下

    TableClient tableClient = getTableClient();

    String myPartitionKey = "partitionkey";
    String myRowKey = "rowkey";

    List<String> propertiesToSelect = new ArrayList<>();
    propertiesToSelect.add("field9");
    propertiesToSelect.add("field10");

    Response<TableEntity> response = tableClient.getEntityWithResponse(myPartitionKey, myRowKey, propertiesToSelect,
            Duration.ofSeconds(5), null);

    TableEntity tableEntity = response.getValue();

    Map<String, Object> properties = tableEntity.getProperties();
    properties.put("field9", "value9");
    properties.put("field10", "value10");
    tableClient.updateEntity(tableEntity, TableEntityUpdateMode.MERGE);

发生的事情是字段值正在更新,但同时一些名称以“odata”开头的字段也被添加到行中。

如何防止这些字段被添加到行中?

感谢您的帮助。

java azure azure-table-storage azure-sdk-for-java
© www.soinside.com 2019 - 2024. All rights reserved.