/* Class name
* Table name (this is the actual table name in the db)
* Column name: List of keywords/datatypes ended with ; A comment
* @ForeignKey: NAME(fk_name); FOREIGNTABLE(other DAL's class name); COLUMNS[Column name, Column name]; FOREIGNCOLUMNS[Column name, Column name]; ONUPDATE(CASCADE/RESTRICT/SETNULL/NOACTION); ONDELETE(CASCADE/RESTRICT/SETNULL/NOACTION);
* @Index: NAME(ix_name); [Column name, column name]; UNIQUE/PRIMARYKEY/SPATIAL/FULLTEXT/BTREE/RTREE/HASH/NONCLUSTERED/CLUSTERED
* @BeforeInsert: Code to execute in beginning of Insert(...) code
* @BeforeUpdate: Code to execute in beginning of Update(...) code
* @AfterRead: Code to execute at the end of Read(...) code
* @MySqlEngine: InnoDB/MyISAM/ARCHIVE (Use MyISAM for geographical, FULLTEXT, and general RTREE indexes)
* @StaticColumns Export column names as static fields (writable) instead of const
* @OmitCollection Omit collection class
* @AtomicUpdates Track atomic column updates
* @SnakeColumnNames Convert columns actual names to snake case
* @InsertAutoIncrement Allow inserting autoincrement values
* @NoCreatedBy Disable the automatic "CreatedBy" setting on Insert
* @NoCreatedOn Disable the automatic "CreatedOn" setting on Insert
* @NoModifiedBy Disable the automatic "ModifiedBy" setting on Update
* @NoModifiedOn Disable the automatic "ModifiedOn" setting on Update
* @NullableEnabled Generate code with nullable types
*/
ColumnName
name - define the actual column name in the db, if it is different than the default specified name
PropertyName
name - define the name of the property, if it is different than the default specified name
Primary Key
- Defines the column as primary key or part of primary key
AutoIncrement
/ Auto Increment
/ AUTO_INCREMENT
- Defines the column as a serial column
Default
value - Sets the DEFAULT value for the column
Nullable
- Defines the column as NULLABLE. Default is NOT NULL.
IsMutatedProperty
- the name of a property specifying whether the column is mutated. Goes hand-in-hand with @AtomicUpdates
Charset
- the name of a character set for this column
Collate
- the name of a collation for this column
Unique
/ Unique Index
- Defines a UNIQUE index on this column
Foreign
TableClassName.ColumnName - Defines a foreign key for this column
SRID 4326
- Will set SRID 4326 for the geometry column
NoProperty
- will remove the property code for this specific column. Can be used to write a custom property
NoRead
- will remove the property from the read routines
NoSave
- will remove the property from the save routines
ActualDefault
value - define a different code-based default value for the class's instance member variable
ActualType
type - The actual .Net type name
ToDB
- Define a format to be used in Insert(...) and Update(...). Can use the {0} specifier for column value in format
FromDB
- Define a format to be used in Read(...). Can use the {0} specifier for column value in format
VirtualProp
- Defines the property as virtual
Specify "Computed
expression_here [STORED]"
INT64
; INT32
; INT16
; INT8
; UINT64
; UINT32
; UINT16
; UINT8
; DOUBLE
; FLOAT
;
DECIMAL
; MONEY
; PRECISION(length)
; SCALE(length)
;
DECIMAL(precision,scale)
; MONEY(precision,scale)
;
DECIMAL(precision)
; MONEY(precision)
;
FIXEDSTRING(length)
; STRING(length)
; TEXT
; LONGTEXT(length)
; MEDIUMTEXT(length)
;
BOOL
; GUID
;
DATETIME
; DATETIME_UTC
; DATETIME_LOCAL
;
DATE
; TIME
;
LITERALTYPE _some_literal_type_here_
NOTE: LITERALTYPE
must come with an ActualType
GEOMETRY
; GEOMETRYCOLLECTION;
POINT;
LINESTRING;
POLYGON;
LINE;
CURVE;
SURFACE;
LINEARRING;
MULTIPOINT;
MULTILINESTRING;
MULTIPOLYGON;
MULTICURVE;
MULTISURFACE`;
GEOGRAPHIC
; GEOGRAPHICCOLLECTION
;
GEOGRAPHIC_POINT
; GEOGRAPHIC_LINESTRING
; GEOGRAPHIC_POLYGON
;
GEOGRAPHIC_LINE
; GEOGRAPHIC_CURVE
; GEOGRAPHIC_SURFACE
; GEOGRAPHIC_LINEARRING
;
GEOGRAPHIC_MULTIPOINT
; GEOGRAPHIC_MULTILINESTRING
; GEOGRAPHIC_MULTIPOLYGON
;
GEOGRAPHIC_MULTICURVE
; GEOGRAPHIC_MULTISURFACE
;
You can define an enum for the column, if specified like this:
/* Column name: DEFAULT EnumName.None; Comment for column:
* "EnumName"
* - None = 0
* - Option1 = 1
* - Option2 = 2
*/