I have a DynamoDb Table. It has a hash key of "ID" and range key of "Category".
I am trying to find all entries for a "Category", comedy for example.
This is my mapping class:
@DynamoDBTable(tableName = "Videos")
public class VideoDynamoMappingAdapter {
private String videoID;
private String videoCategory;
private String videoArtist;
private String videoTitle;
@DynamoDBHashKey(attributeName = "ID")
public String getVideoID() {
return videoID;
}
public void setVideoID(String videoID) {
this.videoID = videoID;
}
@DynamoDBRangeKey(attributeName = "Category")
public String getVideoCategory() {
return videoCategory;
}
public void setVideoCategory(String videoCategory) {
this.videoCategory = videoCategory;
}
@DynamoDBAttribute(attributeName = "ArtistName")
public String getVideoArtist() {
return videoArtist;
}
public void setVideoArtist(String videoArtist) {
this.videoArtist = videoArtist;
}
@DynamoDBAttribute(attributeName = "VideoTitle")
public String getVideoTitle() {
return videoTitle;
}
public void setVideoTitle(String videoTitle) {
this.videoTitle = videoTitle;
}
}
I have been trying to query something like this:
DynamoDBQueryExpression<VideoDynamoMappingAdapter> queryExpression = new DynamoDBQueryExpression<VideoDynamoMappingAdapter>()
.withRangeKeyCondition()
List<VideoDynamoMappingAdapter> itemList = mapper.query(VideoDynamoMappingAdapter.class, queryExpression);
I have been looking over the guide but I can't understand it, I would have thought this would be an easy query that is done all the time so maybe I am missing something:
Thanks in advance for your help