In or around 2001 I started working on a project which was making extensive use of business objects and data objects. I was to be building the front-end website, but was hung up twiddling my thumbs because the business layer and data access layer weren't fully developed. After a couple of weeks of that, I started to take a hard look at what those layers were doing. Basically, they were exposing data returned from stored procedures as collections of objects with properties corresponding to the fields in the data, or were taking input parameters and sending them to stored procedures to be saved to database tables. There was a lot of serialization / deserialization taking place between the two layers, there was Microsoft Transaction Server involved, an IDL / ODL type library ... but it all fit a pattern.
2 weeks later, I had a code generator worked out which would dump out IDL / ODL, and would also dump out the business and data objects. It had taken the guy building the business and data layer objects 2 years to get to the point of debugging and testing these objects. In 2 weeks, with code generation, we had the same output, but because it was all generated it was pretty well bug-free.
That code generator (lower-level CASE tool) followed me around through many different iterations, for about 8 to 10 years, because the principle was just so simple: you're doing something that needs to be done when talking to databases, it's pretty much repetitive coding, and once you get it right you don't have to worry with it any longer.
So, yes: use a code generator, particularly when the coding is repetitive and fits a well-defined pattern.
I've known people to use RegX macros to do similar things, or to use Excel formulas to do similar things (I do this as well).