If I deserialize an object from database which has an enum attribute with constructor the deserilization fails.