Templates

PLINQO for NHibernate is made up of three templates. Add them to your Generator project (.csp) and generate them in this order:

Order Template What it generates
1 Hbms.cst The NHibernate HBM mapping files, from your database.
2 Entities.cst The entity classes and the DataContext, from the HBM files.
3 Queries.cst Query extension methods. Optional.

The QuickStart template sets all three up for you; see Getting started.

When you fill in a template's required properties, the template uses them to fill in the other properties with default values.

Hbms.cst

Category Property Description
1. Required AssemblyName The name of the assembly that contains the business entities.
SourceDatabase The database to generate from.
2. Database CleanExpression Regular expressions that clean table, view and column names.
IgnoreList Regular expressions for the tables, views and commands to leave out of the mapping.
IncludeList Regular expressions for the tables and views to include in the mapping.
IncludeFunctions Includes stored procedures.
IncludeViews Includes views.
3. Directories MapsDirectory The output folder for the mapping files.
4. Naming EntityNamespace The namespace of the business entities.

Entities.cst

Category Property Description
1. Required AssemblyName The name of the assembly that contains the business entities.
SourceDatabase The database to generate from.
2. Directories BaseDirectory The output folder for the base classes.
EntitiesDirectory The output folder for the entity classes.
MapsDirectory The folder that contains the HBM files.
ModelsDirectory The output folder for the model classes (function results and views).
3. Naming BaseNamespace The namespace of the base classes.
DataContextName The name of the generated DataContext.
EntityBaseClass The base class of the PLINQO entities.
GenerateDataContext Generates the DataContext. The queries need it.

Queries.cst

Category Property Description
1. Required SourceDatabase The database to generate from.
2. Directories MapsDirectory The folder that contains the HBM files.
QueriesDirectory The output folder for the query extensions.
3. Naming BaseNamespace The namespace of the base classes.
DataContextName The class name of the DataContext.
QueryNamespace The namespace of the query extensions. Leave it blank to use BaseNamespace.
4. Queries MethodKeySuffix The suffix of primary key query method names.
MethodPrefix The prefix of query method names.
UniqueMethodPrefix The prefix of query methods that return a unique result.