Example usage for com.amazonaws.services.dynamodbv2.document.spec UpdateItemSpec withPrimaryKey

List of usage examples for com.amazonaws.services.dynamodbv2.document.spec UpdateItemSpec withPrimaryKey

Introduction

In this page you can find the example usage for com.amazonaws.services.dynamodbv2.document.spec UpdateItemSpec withPrimaryKey.

Prototype

@Override
    public UpdateItemSpec withPrimaryKey(PrimaryKey primaryKey) 

Source Link

Usage

From source file:com.exorath.service.party.service.DynamoDatabaseProvider.java

License:Apache License

/**
 * Get an update item spec for the given party argument
 * This does not call the update, just returns an object that can be used to update the party
 *
 * @param party Generate the update spec based on this party
 * @return Update spec with all the information to update the party
 *//*  w w w . j  ava  2s  .  c o m*/
private UpdateItemSpec getUpdateItemSpec(Party party) {
    UpdateItemSpec update = new UpdateItemSpec();
    update.withPrimaryKey(new KeyAttribute(PARTY_UUID, party.getPartyUuid()));
    //update.addAttributeUpdate(new AttributeUpdate(PARTY_UUID).put(party.getPartyUuid()));
    update.addAttributeUpdate(new AttributeUpdate(OWNER_UUID).put(party.getOwnerUuid()));
    update.addAttributeUpdate(new AttributeUpdate(SERVER_ID).put(party.getServerId()));
    update.addAttributeUpdate(new AttributeUpdate(MEMBERS).put(party.getMembers()));
    update.addAttributeUpdate(new AttributeUpdate(EXPIRE).put(party.getExpiry()));
    return update;
}