You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We used this function to update values in cassandra but when sending the value Object value as null the code is giving exception , while if updating manually from CQLSH cammand it updates the value to null, so if i have to update a value to null how to do it using updateValue() function of valchkou mapper.
The text was updated successfully, but these errors were encountered:
Hi Eugene,
I checked code for UpdateValues() and found that ,
public static void setValueToUpdateStatement(EntityTypeMetadata emeta, Update update, String propertyName, Object value) {
EntityFieldMetaData fmeta = emeta.getFieldMetadata(propertyName);
if (value.getClass().isEnum()) //Giving null pointer exception here.
{
value = ((Enum<?>) value).name();
}
update.with(set(fmeta.getColumnName(), value));
}
This function is been used internlly to update the values but as we can see that if i pass I want to set a value to null it will come in this code and give null pointer exception in if condition as its performing operation on value as value.getClass() here if value is null it will null pointer exception ,
and coming back to your suggestion of updating values to null by using deleteValue() function i can make null only single value at a time as there is no deleteValues() kind of function so to make multiple columns null i will have to execute this deletevalue() query multiple times.
We used this function to update values in cassandra but when sending the value Object value as null the code is giving exception , while if updating manually from CQLSH cammand it updates the value to null, so if i have to update a value to null how to do it using updateValue() function of valchkou mapper.
The text was updated successfully, but these errors were encountered: