db-torque-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mpoes...@apache.org
Subject cvs commit: db-torque/src/generator/src/java/org/apache/torque/engine/database/model Column.java
Date Thu, 04 Dec 2003 09:40:39 GMT
mpoeschl    2003/12/04 01:40:39

  Modified:    src/generator/src/templates/sql/base/mysql columns.vm
               src/generator/src/java/org/apache/torque/engine/database/model
                        Column.java
  Log:
  use platform.getAutoincrement() instead of db.props
  (mysql only .. more to come)
  
  Revision  Changes    Path
  1.6       +1 -6      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.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- columns.vm	25 Nov 2003 16:57:14 -0000	1.5
  +++ columns.vm	4 Dec 2003 09:40:39 -0000	1.6
  @@ -6,11 +6,6 @@
   		#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.18      +11 -1     db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java
  
  Index: Column.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/model/Column.java,v
  retrieving revision 1.17
  retrieving revision 1.18
  diff -u -r1.17 -r1.18
  --- Column.java	3 Dec 2003 19:16:35 -0000	1.17
  +++ Column.java	4 Dec 2003 09:40:39 -0000	1.18
  @@ -787,6 +787,16 @@
           isAutoIncrement = value;
       }
   
  +    public String getAutoIncrementString()
  +    {
  +        if (isAutoIncrement() 
  +                && IDMethod.NATIVE.equals(getTable().getIdMethod()))
  +        {
  +            return getPlatform().getAutoIncrement();
  +        }
  +        return "";
  +    }
  +    
       /**
        * Set the column type from a string property
        * (normally a string from an sql input file)
  
  
  

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


Mime
View raw message