if ( getterResult == null && reflector.isAssignableKey(method) ) {
onAutoGenerateAssignableKey(method, attributeName);
}
else {
AttributeValue newAttributeValue = getSimpleAttributeValue(method, getterResult);
if ( newAttributeValue == null ) {
throw new DynamoDBMappingException("Null or empty value for key: " + method);
}
onKeyAttributeValue(attributeName, newAttributeValue);
}
}
/*
* Next construct an update for every non-key property
*/
for ( Method method : reflector.getRelevantGetters(clazz) ) {
// Skip any key methods, since they are handled separately
if ( keyGetters.contains(method) )
continue;
Object getterResult = safeInvoke(method, object);
String attributeName = reflector.getAttributeName(method);
/*
* If this is a versioned field, update it
*/
if ( reflector.isVersionAttributeGetter(method) ) {
onVersionAttribute(method, getterResult, attributeName);
nonKeyAttributePresent = true;
}
/*
* Otherwise apply the update value for this attribute.
*/
else {
AttributeValue currentValue = getSimpleAttributeValue(method, getterResult);
if ( currentValue != null ) {
updateValues.put(attributeName, new AttributeValueUpdate().withValue(currentValue)
.withAction("PUT"));
nonKeyAttributePresent = true;
} else {