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/21 18:57:52 UTC

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

mpoeschl    2004/01/21 09:57:52

  Modified:    src/generator/src/templates/sql/base/postgresql columns.vm
               src/generator/src/templates/sql/base/oracle columns.vm
  Log:
  use Column.getSqlString()
  
  Revision  Changes    Path
  1.6       +2 -36     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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- columns.vm	17 Jan 2004 01:53:28 -0000	1.5
  +++ columns.vm	21 Jan 2004 17:57:52 -0000	1.6
  @@ -1,38 +1,4 @@
   #foreach ($col in $table.Columns)
  -  #set ( $type = $col.Domain.SqlType )
  -  #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 ( $entry = "$col.Name $type $size $default $col.NotNullString" )
  -  #set ( $entry = $strings.select($col.isAutoIncrement(), "$col.Name $col.AutoIncrementString", $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," ,",",")
  +    #set ( $entry = "$col.SqlString," )
  +    $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  
  1.4       +1 -4      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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- columns.vm	17 Jan 2004 01:53:28 -0000	1.3
  +++ columns.vm	21 Jan 2004 17:57:52 -0000	1.4
  @@ -1,7 +1,4 @@
   #foreach ($col in $table.Columns)
  -    #set ( $type = $col.Domain.SqlType )
  -    #set ( $size = $col.printSize() )
  -    #set ( $default = $col.DefaultSetting )
  -    #set ( $entry = "$col.Name $type $size $default $col.NotNullString," )
  +    #set ( $entry = "$col.SqlString," )
       $strings.sub($strings.collapseSpaces($entry)," ,",",")
   #end
  
  
  

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