I can insert an Object(annotated with @DynamoDBTable) in DynamoDB using to following code
@Autowired
private SdnInformationRepository sdnInformationRepository;
SdnInformation inf = new SdnInformation();
inf.setFirstName("firstname");
inf.setLastName("lastname");
sdnInformationRepository.save(inf);
Here is my repository
public interface SdnInformationRepository extends
CrudRepository<SdnInformation, String> {
}
and my model
@DynamoDBTable(tableName = "SdnList")
public class SdnInformation {
@DynamoDBHashKey(attributeName = "Id")
@DynamoDBAutoGeneratedKey
private String id;
private String firstName;
private String lastName;
public String getFirstName() {
return firstName;
}
public void setFirstName(String firstName) {
this.firstName = firstName;
}
public String getLastName() {
return lastName;
}
public void setLastName(String lastName) {
this.lastName = lastName;
}
}
Everything works fine here. I want to know whether it is possible to insert a List/Set of SdnInformation objects at once? If I insert a huge number of such objects individually it takes too much time. So I want something like
Set<SdnInformation> listToInsert = new HashSet<SdnInformation>();
... some code to fill my set with thousands of objects ...
sdnInformationRepository.save(listToInsert);