Skip to content

Commit

Permalink
#932, fix for enum type
Browse files Browse the repository at this point in the history
  • Loading branch information
karthikprasad13 committed Apr 7, 2017
1 parent 674c7db commit 1584ae5
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1421,7 +1421,12 @@ else if (type.getClass().getSimpleName().equals("SetType"))
serializer.validate(field);

Object finalValue = serializer.deserialize(field);
PropertyAccessorHelper.set(entity, fieldToSet, finalValue);
if (type.getClass().getSimpleName().equals("UTF8Type")){
PropertyAccessorHelper.set(entity, fieldToSet, ((String) finalValue).getBytes());
}
else{
PropertyAccessorHelper.set(entity, fieldToSet, finalValue);
}
}

}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,9 @@ public static CassandraType get(String clazz)
*/
public static CassandraType getCassandraDataTypeClass(Class clazz)
{

if(clazz.isEnum()){
return CassandraType.STRING;
}
return typeToClazz.get(clazz);
}

Expand Down

0 comments on commit 1584ae5

Please sign in to comment.