cassandra datastax client is not mapping null primitive type while reading

26 views
Skip to first unread message

Ravikumar Sundaram

unread,
Sep 23, 2015, 4:59:37 PM9/23/15
to kundera-discuss

I am using kundera for my cassandra store. I am using DSClientFactory i.e. datastax client.
I have an entity which has an Integer field and the corresponding column in cassandra table is on type int & it is nullable.
(My table name is inventory. one of the column name is min_value which is int type and this column can contain null value. The corresponding java entity name is Inventory, one of the attribute is minValue which is Integer type.)

I am able to persist null value in that column using kundera. But if i read an entity which has null value in the min_value column from database using kundera, the returned java entity has 0 as value for the minValue attribute instead of null.

I debugged it and found the root cause for the issue. The issue is in DSClientUtilities.java (the assign() method). it is not checking whether the resultant column value is null before populating the attribute value in entity. https://github.com/impetus-opensource/Kundera/blob/6e84e50334a99ba602e7a3cff2a415aa258de68e/src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientUtilities.java#L172



This is very fundamental bug. Is there any workaround or fix for this ? if not, How do i approach kundera development team to fix this.  

Reply all
Reply to author
Forward
0 new messages