Use role for generated code instead of base class