Comments (5)
Hi tnatarajan,
This is actually an intended behavior, as described in javadoc for save operation:
For updates, a null value for an object property will remove it from that item in DynamoDB.
So for your case, one possible solution would be to use a trimmed domain class that doesn't model the attributes that are expected to remain unchanged.
Considering that this is rather an inconvenient workaround, yet it is still very important for us to avoid any changes that could break existing customers' code, we are thinking of providing a third option for SaveBehavior (something like UPDATE_IGNORE_NULL_ATTRIBUTES), which would force the save operation to NOT remove null-valued attributes.
By doing it, we could both support the desired "partial" UPDATE and keep our code as backward-compatible. What do you think?
Thanks.
-Shuo
from aws-sdk-java.
Hi Shuo,
Thanks for clarification, that's good to know. It will be great if we have that new SaveBehavior.
Thanks, Thiru
from aws-sdk-java.
Just letting you know that the latest version 1.5.3 includes a new SaveBehavior. From the release notes:
The high-level DynamoDBMapper class now supports a new SaveBehavior strategy, called UPDATE_SKIP_NULL_ATTRIBUTES. This new SaveBehavior is very similar to the existing UPDATE strategy. The only difference is that any attributes sent with null values will not be removed from the item in DynamoDB.
from aws-sdk-java.
Correction: UPDATE_SKIP_NULL_ATTRIBUTES is available in 1.5.4, not in 1.5.3:
http://aws.amazon.com/releasenotes/Java/2365482772829983
from aws-sdk-java.
Oops, sorry about that! Thanks @hanshuo-aws!
from aws-sdk-java.
Related Issues (20)
- s3: resource object-lock should be in string to sign when use v2 signer, otherwise will be 403 signature not match HOT 4
- Updating aws-java-sdk-sqs from 1.12.583 to 1.12.584 breaks @JmsListener HOT 3
- EKS Pod Identity - Cannot get credentials HOT 15
- Direct memory leak when getting object metadata inside parallelStream with Java 17 HOT 2
- S3 - The authorization header is malformed; the region 'vpce' is wrong; HOT 3
- Create option to specify custom options/properties in request builder to be passed down in the SignRequest during the signing stage
- Unsupported or unrecognized SSL message(short issue description) HOT 2
- (short issue description) HOT 2
- Unable to parse clock skew offset from response: null HOT 2
- AWS SDK1 Java does not provide ability to authenticate to AWS STS via proxy that requires Kerberos Authentication HOT 1
- Credential Provider Chain Not Working HOT 4
- Use of deprecated ion-java HOT 19
- GetBlobStoreContext failing after updating the aws-sdk HOT 3
- Error while publishing the image using the pre-signed url generated. (SignatureDoesNotMatch) HOT 4
- Single Table Design Pattern - Fetch only selected entities by giving begins_with or starts_with sort key HOT 1
- Update dependency: httpcomponents HOT 2
- Update jackson-databind dependency HOT 2
- ClusterNotFoundException is thrown when cluster exists in the account/region HOT 3
- [Auth] the pod falling back to instance role instead of IRSA HOT 2
- AWS SDK Metrics not reporting HttpClientPoolAvailableCount or HttpClientPoolPendingCount HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aws-sdk-java.