Delegate type_cast to injected type object in mysql