⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 columns.vm

📁 一个数据访问层Torque3.1的生成器的源代码
💻 VM
字号:
#foreach ($col in $table.Columns)    #if ($col.TorqueType.indexOf("BOOLEAN") != -1)       #set ( $type = $dbprops.get($col.TorqueType) )    #else       #set ( $type = $dbprops.get($col.Type) )    #end    #if ($col.TorqueType.indexOf("INT") == -1)        #set ( $size = $col.printSize() )    #else        #set ( $size = "" )    #end    #if (($table.IdMethod == "native") && ($col.isPrimaryKey()))      #set ( $default = "DEFAULT nextval('$table.SequenceName')" )    #else      #set ( $default = $col.DefaultSetting )    #end    #set ( $nullString = $strings.select($col.isNotNull(), $dbprops.get("NOTNULL"),"") )    #set ( $entry = "$col.Name $type $size $default $nullString" )    #if ($col.isAutoIncrement() && $table.IdMethod == "native")      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )    #else      #set ( $autoIncrement = " " )    #end        #set ( $entry = $strings.select($col.isAutoIncrement(), "$col.Name $autoIncrement", $entry) )#### the following works if you want to inline your foreign keys## if you turn it on, be sure to comment out foreignkey.vm#if (false)  #if ($col.isForeignKey())    #set ($fk = $col.ForeignKey)    #set ($entry = "$entry REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)")    #if ($fk.hasOnUpdate())      #set ($entry = "$entry ON UPDATE $fk.OnUpdate ")    #end    #if ($fk.hasOnDelete())      #set ($entry = "$entry ON DELETE $fk.OnDelete ")    #end  #end#end## add a nice comment#if ($col.isForeignKey())  #set ($fk = $col.ForeignKey)      -- REFERENCES $fk.ForeignTableName ($fk.ForeignColumnNames)#end#set ( $entry = $strings.collapseSpaces("$entry,") )    $strings.sub($entry," ,",",")#end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -