You are viewing a plain text version of this content. The canonical link for it is here.
Posted to torque-dev@db.apache.org by mp...@apache.org on 2004/01/17 02:53:28 UTC

cvs commit: db-torque/src/generator/src/templates/sql/base Control.vm

mpoeschl    2004/01/16 17:53:28

  Modified:    src/generator/src/templates/sql/base/postgresql columns.vm
               src/generator/src/templates/sql/base/hypersonic columns.vm
               src/generator/src/templates/sql/base/oracle columns.vm
               src/generator/src/templates/sql/base/interbase columns.vm
               src/generator/src/templates/sql/base/axion columns.vm
               src/generator/src/templates/sql/base/cloudscape columns.vm
               src/generator/src/templates/sql/base/mysql table.vm
                        columns.vm
               src/generator/src/templates/sql/base/msaccess columns.vm
               src/generator/src/templates/sql/base/db2400 columns.vm
               src/generator/src/templates/sql/base/sapdb columns.vm
               src/generator/src/templates/sql/base/db2 columns.vm
               src/generator/src/templates/sql/base/mssql columns.vm
               src/generator/src/templates/sql/base/sybase columns.vm
               src/generator/src/templates/sql/base Control.vm
  Log:
  don't use db.props files any longer
  
  Revision  Changes    Path
  1.5       +2 -11     db-torque/src/generator/src/templates/sql/base/postgresql/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/postgresql/columns.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- columns.vm	5 Dec 2003 16:38:26 -0000	1.4
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.5
  @@ -1,9 +1,5 @@
   #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
  +  #set ( $type = $col.Domain.SqlType )
     #if ($col.TorqueType.indexOf("INT") == -1)
       #set ( $size = $col.printSize() )
     #else
  @@ -15,12 +11,7 @@
       #set ( $default = $col.DefaultSetting )
     #end
     #set ( $entry = "$col.Name $type $size $default $col.NotNullString" )
  -  #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) )
  +  #set ( $entry = $strings.select($col.isAutoIncrement(), "$col.Name $col.AutoIncrementString", $entry) )
   
   ##
   ## the following works if you want to inline your foreign keys
  
  
  
  1.4       +2 -7      db-torque/src/generator/src/templates/sql/base/hypersonic/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/hypersonic/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	25 Nov 2003 16:57:13 -0000	1.3
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.4
  @@ -1,12 +1,7 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
       #set ( $default = $col.DefaultSetting )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  -    #set ( $entry = "$col.Name $type $size $autoIncrement," )
  +    #set ( $entry = "$col.Name $type $size $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.3       +1 -1      db-torque/src/generator/src/templates/sql/base/oracle/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/oracle/columns.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- columns.vm	25 Nov 2003 16:57:13 -0000	1.2
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.3
  @@ -1,5 +1,5 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
       #set ( $default = $col.DefaultSetting )
       #set ( $entry = "$col.Name $type $size $default $col.NotNullString," )
  
  
  
  1.4       +2 -7      db-torque/src/generator/src/templates/sql/base/interbase/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/interbase/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	25 Nov 2003 16:57:13 -0000	1.3
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.4
  @@ -1,13 +1,8 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
       #set ( $default = $col.DefaultSetting )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
       #set ( $colName = $strings.concat(['"',$col.Name,'"']) )
  -    #set ( $entry = "$colName $type $size $default $col.NotNullString $autoIncrement," )
  +    #set ( $entry = "$colName $type $size $default $col.NotNullString $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.4       +2 -7      db-torque/src/generator/src/templates/sql/base/axion/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/axion/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	2 Dec 2003 10:39:09 -0000	1.3
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.4
  @@ -1,10 +1,5 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  -    #set ( $entry = "$col.Name $type $autoIncrement," )
  +    #set ( $type = $col.Domain.SqlType )
  +    #set ( $entry = "$col.Name $type $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.5       +2 -7      db-torque/src/generator/src/templates/sql/base/cloudscape/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/cloudscape/columns.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- columns.vm	2 Dec 2003 10:39:09 -0000	1.4
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.5
  @@ -1,11 +1,6 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  -    #set ( $entry = "$col.Name $type $size $autoIncrement," )
  +    #set ( $entry = "$col.Name $type $size $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.3       +1 -2      db-torque/src/generator/src/templates/sql/base/mysql/table.vm
  
  Index: table.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/mysql/table.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- table.vm	2 Dec 2003 02:41:23 -0000	1.2
  +++ table.vm	17 Jan 2004 01:53:28 -0000	1.3
  @@ -15,5 +15,4 @@
   #if($strings.allEmpty([$unique,$index]) && $fk.length() >0)$strings.chop($fk,2)#else$fk#end
   #if($strings.allEmpty([$index]) && $unique.length()>0)$strings.chop($unique,2)#else$unique#end
   #if($index.length() > 0)$strings.chop($index,2)#end
  -
  -)#if($dbprops.get('tableType')) Type=$dbprops.get('tableType')#end;
  +)
  
  
  
  1.7       +1 -1      db-torque/src/generator/src/templates/sql/base/mysql/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/mysql/columns.vm,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- columns.vm	4 Dec 2003 09:40:39 -0000	1.6
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.7
  @@ -1,5 +1,5 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
   	#if ( $type == 'MEDIUMTEXT' || $type == 'LONGTEXT' || $type == 'BLOB' || $type == 'MEDIUMBLOB' || $type == 'LONGBLOB' )
   		#set ( $size = '' )
   	#else
  
  
  
  1.4       +2 -7      db-torque/src/generator/src/templates/sql/base/msaccess/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/msaccess/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	25 Nov 2003 16:57:13 -0000	1.3
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.4
  @@ -1,12 +1,7 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
       #set ( $default = $col.DefaultSetting )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  -    #set ( $entry = "$col.Name $type $size $autoIncrement," )
  +    #set ( $entry = "$col.Name $type $size $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.4       +2 -7      db-torque/src/generator/src/templates/sql/base/db2400/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/db2400/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	25 Nov 2003 16:57:13 -0000	1.3
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.4
  @@ -1,12 +1,7 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
       #set ( $default = $col.DefaultSetting )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  -    #set ( $entry = "$col.Name $type $size $default $col.NotNullString $autoIncrement," )
  +    #set ( $entry = "$col.Name $type $size $default $col.NotNullString $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.3       +1 -1      db-torque/src/generator/src/templates/sql/base/sapdb/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/sapdb/columns.vm,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- columns.vm	25 Nov 2003 16:57:14 -0000	1.2
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.3
  @@ -1,5 +1,5 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
       #set ( $default = $col.DefaultSetting )
       #set ( $entry = "$col.Name $type $size $default $col.NotNullString," )
  
  
  
  1.5       +5 -10     db-torque/src/generator/src/templates/sql/base/db2/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/db2/columns.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- columns.vm	25 Nov 2003 16:57:14 -0000	1.4
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.5
  @@ -1,23 +1,18 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #set ( $size = $col.printSize() )
       #if ( $type == "INTEGER" )
           #set ( $size = "" )
       #end
       #set ( $rawsize = $col.Size )
       #set ( $torquetype = $col.TorqueType )
  -    #set ( $default = $col.DefaultSetting )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  +    #set ( $default = $col.DefaultSetting )  
       #if ( $torquetype == "BINARY" )
  -        #set ( $entry = "$col.Name CHAR($rawsize) FOR BIT DATA $default $col.NotNullString $autoIncrement," )
  +        #set ( $entry = "$col.Name CHAR($rawsize) FOR BIT DATA $default $col.NotNullString $col.AutoIncrementString," )
       #elseif ( $torquetype == "VARBINARY" )
  -        #set ( $entry = "$col.Name VARCHAR($rawsize) FOR BIT DATA $default $col.NotNullString $autoIncrement," )
  +        #set ( $entry = "$col.Name VARCHAR($rawsize) FOR BIT DATA $default $col.NotNullString $col.AutoIncrementString," )
       #else
  -        #set ( $entry = "$col.Name $type $size $default $col.NotNullString $autoIncrement," )
  +        #set ( $entry = "$col.Name $type $size $default $col.NotNullString $col.AutoIncrementString," )
       #end
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.4       +2 -7      db-torque/src/generator/src/templates/sql/base/mssql/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/mssql/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	25 Nov 2003 16:57:14 -0000	1.3
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.4
  @@ -1,17 +1,12 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #if ($type == "INT" || $type == "TEXT")
         #set ( $size = "" )
       #else   
         #set ( $size = $col.printSize() )
       #end
       #set ( $default = $col.DefaultSetting )
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  -    #set ( $entry = "$col.Name $type $size $default $col.NotNullString $autoIncrement," )
  +    #set ( $entry = "$col.Name $type $size $default $col.NotNullString $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
   
  
  
  
  1.4       +2 -12     db-torque/src/generator/src/templates/sql/base/sybase/columns.vm
  
  Index: columns.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/sybase/columns.vm,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	25 Nov 2003 16:57:14 -0000	1.3
  +++ columns.vm	17 Jan 2004 01:53:28 -0000	1.4
  @@ -1,20 +1,10 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $dbprops.get($col.Type) )
  +    #set ( $type = $col.Domain.SqlType )
       #if ($type == "INT" || $type == "TEXT")
         #set ( $size = "" )
       #else   
         #set ( $size = $col.printSize() )
       #end
  -    #if ( $dbprops.get("suppressDefaults") == "true" )
  -        #set ( $default = "" )
  -    #else
  -        #set ( $default = $col.DefaultSetting )
  -    #end
  -    #if ($col.isAutoIncrement() && $table.IdMethod == "native")
  -      #set ( $autoIncrement = $dbprops.get("AUTOINCREMENT") )
  -    #else
  -      #set ( $autoIncrement = " " )
  -    #end    
  -    #set ( $entry = "$col.Name $type $size $default $col.NotNullString $autoIncrement," )
  +    #set ( $entry = "$col.Name $type $size $col.DefaultSetting $col.NotNullString $col.AutoIncrementString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.5       +0 -1      db-torque/src/generator/src/templates/sql/base/Control.vm
  
  Index: Control.vm
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/templates/sql/base/Control.vm,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Control.vm	2 Dec 2003 02:35:10 -0000	1.4
  +++ Control.vm	17 Jan 2004 01:53:28 -0000	1.5
  @@ -1,5 +1,4 @@
   #set ( $basepath = "sql/base/$targetDatabase" )
  -#set ( $dbprops = $properties.load("sql/base/$targetDatabase/db.props") )
   #set ( $fname= "sql/base/$targetDatabase/table.vm" )
   #set ( $fnamekeys= "sql/base/$targetDatabase/tablefk.vm" )
   #set ( $idname = "sql/id-table/idtable.$targetDatabase" )
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: torque-dev-unsubscribe@db.apache.org
For additional commands, e-mail: torque-dev-help@db.apache.org