AnCode + + is a code generator, which is suitable for the animal.orm framework, and can also customize the internal structure and data type for your own orm framework.

image

Generate Model 

image

Aconfig.xml

<?xml version="1.0" encoding="utf-8"?>
<AnimalConfig>
  <!--1.Model Suffix Name-->
  <EntitySuffixName>Entity</EntitySuffixName>
  <!--2.Model NameSpance-->
  <EntityNameSpance>AnCodeDemo</EntityNameSpance>
  <!--3.Show Attribute(Tiger、Koala、Cat) 1 Show 0 Hide-->
  <UseAttribute>1</UseAttribute>
  <!--3.1 Desc Table Name-->
  <TigerAttribute>Tiger</TigerAttribute>
  <!--3.2 Desc Primary Key and Self growth-->
  <KoalaTrueAttribute>Koala(true)</KoalaTrueAttribute>
  <!--3.3 Desc Primary Key-->
  <KoalaAttribute>Koala</KoalaAttribute>
  <!--3.4 Desc Column-->
  <CatAttribute>Cat</CatAttribute>
  <!--4.Using Attribute NameSpance-->
  <AttributeNameSpance>using Animal.ORM.Model;</AttributeNameSpance>   
  <!--5.Using The Third NameSpance-->
  <UsingThirdNameSpance/>
  <UsingThirdNameSpance2/>
  <UsingThirdNameSpance3/>
  <UsingThirdNameSpance4/>
  <UsingThirdNameSpance5/>
  <!--6.System Base Type Config,if not exists the type is string-->
  <BaseTypeList>
    <AnimalBaseType>
      <BaseTypeName>long</BaseTypeName>
      <BaseTypeVsDbColumnTypeNames>bigint</BaseTypeVsDbColumnTypeNames>
    </AnimalBaseType>
    <AnimalBaseType>
      <BaseTypeName>int</BaseTypeName>
      <BaseTypeVsDbColumnTypeNames>int,bit,year</BaseTypeVsDbColumnTypeNames>
    </AnimalBaseType>
    <AnimalBaseType>
      <BaseTypeName>string</BaseTypeName>
      <BaseTypeVsDbColumnTypeNames>char,text,json,xml</BaseTypeVsDbColumnTypeNames>
    </AnimalBaseType>
    <AnimalBaseType>
      <BaseTypeName>DateTime</BaseTypeName>
      <BaseTypeVsDbColumnTypeNames>datetime,time,date,timestamp</BaseTypeVsDbColumnTypeNames>
    </AnimalBaseType>
    <AnimalBaseType>
      <BaseTypeName>double</BaseTypeName>
      <BaseTypeVsDbColumnTypeNames>real,float,double,number,numeric</BaseTypeVsDbColumnTypeNames>
    </AnimalBaseType>
    <AnimalBaseType>
      <BaseTypeName>decimal</BaseTypeName>
      <BaseTypeVsDbColumnTypeNames>decimal,money</BaseTypeVsDbColumnTypeNames>
    </AnimalBaseType>
    <AnimalBaseType>
      <BaseTypeName>Byte[]</BaseTypeName>
      <BaseTypeVsDbColumnTypeNames>binary,blob,image</BaseTypeVsDbColumnTypeNames>
    </AnimalBaseType>
  </BaseTypeList>
  <!--7.System Base Nullable Type Config, eg int?,DateTime?-->
  <BaseNullableTypeArray>int,DateTime,double,decimal,long,bool</BaseNullableTypeArray>
</AnimalConfig>

Code

image

Demo

https://download.csdn.net/download/niuzai520/15741899


DJ_Ryan
1 声望0 粉丝