Skip to content
christoforosl edited this page May 9, 2015 · 30 revisions

Code Generation of ORM classes

Before you generate the the ORM classes, you need to create 2 .net projects.

First the "Model" project, which will contain:
(1) The XML Generation Control File.
(2) All generated ORM classes.

In addition, a Test Project needs to be created. The test Project will receive Test classes generated by the code generator.

### Preparing your database The next step is to make sure your database follows these simple conventions:

1. All tables should have a SINGLE primary key field. If you have composite keys, you can Add a new primary key and make the composite key fields to compose a unique index.

2. Primary Keys should be either Integer, Long or String fields.

### Prepare XML Generation Control File The next step is to prepare the XML Generation Control File. This file tells the code generator for which tables in the database it should generate ORM classes for.

A sample file can be found here: Sample XML for C# generation

The XSD file is at this URL: https://raw.githubusercontent.com/christoforosl/codegen-lib/master/org.codegen.libs/org.codegen.lib/classGenerator.4.xsd

Run unit Tests

Clone this wiki locally