template.conf.sit_javaee6.db-mysql.vm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sit-ad Show documentation
Show all versions of sit-ad Show documentation
SIToolkit for Application Develepment
CREATE TABLE $table.pname (
#foreach ($column in $table.columns)
$column.pname $column.type #declareLength($column) $column.delareNotNull,
#end
deleted_flg SMALLINT NOT NULL DEFAULT 0,
version INTEGER NOT NULL DEFAULT 0,
created TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
created_by CHAR(8) NOT NULL DEFAULT 'system',
updated TIMESTAMP NOT NULL ,
updated_by CHAR(8) DEFAULT 'system',
#foreach ($fk in $table.fkMap.entrySet())
FOREIGN KEY ($fk.value.srcCols) REFERENCES $fk.value.dstTable ($fk.value.dstCols) ,
#end
PRIMARY KEY (#foreach ($column in $table.pks) #if ($velocityCount > 1), #end $column.pname #end)
);
#*****************************************************
*
*
****************************************************#
#macro (declareLength $column)
#set ($type = $column.type.toUpperCase())
#if ($type == "VARCHAR" || $type == "CHAR" || $type == "DECIMAL" || $type == "BLOB" || $type == "TEXT")($column.length)#end
#end