Database Reference
In-Depth Information
item2.put("Publisher", new AttributeValue().withS("TMH"));
item2.put("PubDate", new
AttributeValue().withS("28-Jul-12"));
item2.put("Language", new AttributeValue()
.withSS(Arrays.asList("English")));
item2.put("Edition", new AttributeValue().withN("1"));
item2.put("Pages", new AttributeValue().withN("623"));
PutItemRequest putItemRequest1 = new PutItemRequest()
.withTableName(tableName)
.withItem(item2);
client.putItem(putItemRequest1);
}
In the getTableAttributes method, we have not specified or defined the Pages
and Language attributes.
Tip
While creating the table, we must specify the primary key and index attributes; all other
optional attributes can be specified during item insertion. The Pages and Language at-
tributes, being non-key and non-index attributes, are not part of AttributeDefini-
tion in the getTableAttributes method.
There are two more local functions invoked to create indexes, which we will see in the
next chapter.
Search WWH ::




Custom Search