Mix the corn meal, flour, baking powder, salt, sugar and paprika in a large mixing bowl.
Combine the egg, milk, shortening and corn in another mixing bowl.
Add this to the dry ingredients; mix to just combined.
In a saucepan, melt the butter; saute the onions, chiles and pimento until the onions are transparent.
Add this to the rest of the batter, once it has cooled a bit.
Add the cheese.
Mix well, but don't over mix.
Preheat the oven to 400.
Butter an 8-inch square pan; pour in the batter.
Bake for 35 minutes.
Cool, then cut into serving sized pieces.