I have finally released my Code Generator to Google Code as Active-Record-Gen. What does it generate? It generates ActiveRecord classes mainly, but I have used it to generate stored procedures and sys-admin scripts as well. This code generator does not (yet) generate a full Windows application project or a Mono-Rail web site, but the generated code could be used in either. In fact, with a few tweaks, this could be used to generate NHibernate "poco" and .xbm files. If you want to know more, look at the screen shots above, or head over to Google Code and run it. In my haste to make my first EXE release before supper, I forgot to add the Template directory, which should be at the same directory level as the EXE and config files. I just (1.5 hours later) uploaded a new EXE, but 2 people have already downloaded the EXE (not the source though).
As for the basic table object, it is built with the following assumptions:
Table name is plural, class name is singular.
Field "ID" is the primary key (at some point, this decision will be based on the SQL schema.
Fields ending in _ID are foreign keys (Department_ID is a foreign key to the Departments table).
Generated objects have the [ActiveRecord], [PrimaryKey], [Property], and [BelongsTo] attributes.
Comments