Skip to content
A flexible lightweight code(java/C#/ruby etc.) generation tool.一款简单易用且轻量级的基于数据库物理模型的代码生成工具
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.



CodeBuilder(中文版) is a lightweight base Database Physical Data Model's code (C#/java/ruby/php/xml etc.) generation tool.


Features from Powerdesinger 12+ PDM file import to Data Model from MySql5/SQLserver2000/2005/2008/Oralce Database import to Data Model velocity template engine for code template

User Guide


a.windows7 or later framework4.0 or later(Optional)

Quick Start

  1. Installation
    Download the Binary only distribution then extract it
  2. Config DataSource
    Open CodeBuilder folder then double click codebuilder.exe file run Appliction
    click (tools->datasource configuration) add new datasource item
  3. Import Database Tables & Views
    click (files->export from datasource->selected database) and watting until list all tables and views of current database
  4. Generate Codes
    a.checked some(or all) tables and views programming language(c#/java/ruby/php/xml etc.)
    c.fill root package or namespaces (eg:com.easytoolsoft.codebuilder)
    d.fill prefix of table& view name,code author and version (Optional) one or more code template for generation,if you want to customize template please ref Make Template
    f.if want remove table&views prefix(eg:cb_table1,cb_table2's cb is prefix,also you need fill prefix of table& view name by step d) and Camel-Case class or field name (eg:easy_tools_soft will transfer to EasyToolsSoft) when you generation code, you should check "is omit table prefix" or "is Camel-Case name"
    qs-img3 "generate" button start execute code build then click file bar open genenrated code file directory

Make Template

1.Create code template by apache velocity
create a text file(eg:example.txt) with UTF-8 encoding,use TDO by velocity
2.Template Data Object(TDO)
a.TDO Properties

Name Type Comment
Name string template data name
Language string programming language (eg:csharp/java/ruby/php/xml etc.)
Database string database (eg:mysql5/sqlserver2000/2005/2008/oralce etc.)
Package string namespaces or package name (eg:com.easytoolsoft)
TablePrefix string table name prefix(eg:cb_table's prefix is "cb")
Author string code author name
Version string code version
TemplateEngine string template engine name default is nvelocity
TemplateName string template display name( file displayname is "example")
Prefix string template prefix
Suffix string template suffix
Encoding string code file encoding (eg:utf8/utf7/ascii etc.)
TemplateFileName string template file name(
CodeFileName string generated code file name(
IsOmitTablePrefix bool is omit table prefix (eg:cb_table will remove "cb")
IsCamelCaseName bool is Camel-Case tables ,views,columns,fields name(eg:cb_table -> Cb_Table)
ModelObject object in the corresponding database tables and views.please ref:b.ModelObject Properties

b.ModelObject Properties

Name Type Comment
Id string table or view name(eg:cb_table)
DisplayName string table or view display name, default is Name property
Name string table or view Upper Camel-Case name(eg:cb_table -> CbTable)
OriginalName string talbe or view name(eg:cb_table)
Comment string table or view's comment
MetaTypeName string meta data type is:(table
Columns Dictionary[string,Column] table or view's column collection,please ref:c.Column Properties
PrimaryKeys Dictionary[string,Column] table's Primary key column collection
Keys Dictionary[string,Column] table's Non-Primary key column collection

c.Column Properties

Name Type Comment
Id string column name (eg:first_name)
DisplayName string column display name, default is Name
Name string column Upper Camel-Case name(eg:first_name -> FirstName)
LowerCamelName string column Lower Camel-Case name(eg:first_name -> firstName)
OriginalName string column name (eg:first_name)
Comment string column's comment
DataType string column data type of database (eg: mysql int/bigint/varchar etc.)
DefaultValue string column default value of database
LanguageType string column mapping to programming language (eg:c#/java/ruby etc.) data type (eg: C# int/long/string etc.)
LanguageDefaultValue string column default value of programming language (eg:c#/java/ruby etc.)
Length int column data type length of database
Ordinal int column sequence of table or view
IsAutoIncremented bool column whether auto incremented field
IsNullable bool column whether is null field
IsComputed bool column whether is computed field
HasDefault bool column whether default value
MetaTypeName string meta data type is "column"

3.Add Template when templates completed,you should add it to codebuilder







For Developers


a.VS2010+ or sharpdevelop4.1+
c.nunit2.5 or later
d.moq3 or later




You can’t perform that action at this time.