DynamoDBMapper provides various ways to read a single item from a table:
Is there any recommendation which one to use? In a quick test, the following two code fragments return the same "MyEntry" element for a table with primary key = hash and range key = date, while the query method is about 10% faster.
load
public MyEntry getEntryForDay(final Integer hash, final LocalDate date) { return mapper.load(MyEntry.class, hash, date); }
request
public MyEntry getEntryForDay(final Integer hash, final LocalDate date) { final MyEntry hashKeyValues = new MyEntry (); hashKeyValues.setHash(hash); final Condition rangeKeyCondition = new Condition()
source share