EntityRef::serialize is const