Serializes object with association.