Check Maintainable framework. Although I prefer code generation over ActiveRecord (runtime reflection), I found Maintainable framework easy to use especially in terms of ORM features.
http://framework.maintainable.com/mvc/3_model.php#c3.7
If you want a framework based on code generation, try QCodo. Whatever dcousineau said for Doctrine, I can say for Qcodo. This is an event driven full-fledged framework imitating .NET/Delphi. However you can just code generation feature and find ways to dissociate your generated classed from the rest of the framework. Thus, you can embed generated classed within other frameworks.