add generic serialization to entity attributes