Null values are getting written when using a custom put resolver to prevent it
See original GitHub issueI created a put resolver that looks like this:
public class UserPutResolver extends UserStorIOSQLitePutResolver {
@NonNull
@Override
public ContentValues mapToContentValues(@NonNull User user) {
ContentValues contentValues = super.mapToContentValues(user);
if(TextUtils.isEmpty(user.getEmail())) {
contentValues.remove(UsersTable.COLUMN_EMAIL);
}
return contentValues;
}
}
Bascially if the user’s email is null, I don’t want to override it, so I remove the content value. When debugging, I know it hits this line and properly returns the ContentValues object without the email column.
I know I can use the ignorenull
property, but i want to know why this is not working.
Issue Analytics
- State:
- Created 7 years ago
- Comments:6
Top Results From Across the Web
Skip null values with custom resolver - Stack Overflow
I have created a class which automatically goes through all the contracts are creates mappings. The only problem I have is that I...
Read more >Using nullability in GraphQL
A field can either be nullable or non-null, and this tells you whether or not you could receive a null value when you...
Read more >Solved: Update blank/Null value to fields (Date, User, Cho...
Solution : Enable the "Experimental features" as shown in below screenshot. This will resolve the issue and you will be able to update...
Read more >Handling Null and Other Special Values - Tableau Help
To filter null dimensions or discrete measures, drag the pill to the Filter shelf and deselect Null. The null value will appear in...
Read more >Why Hive Table is loading with NULL values?
You are getting NULL values loaded to the Hive table because your data is in comma-separated whereas Hive default separator is ^A hence...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closed for now Feel free to reopen if you got this behavior on some sample code that you can publish 😉
hmm… interesting. yea, i’ll try to reproduce it and let you know if I am successful