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/platform PlatformPostgresqlImpl.java PlatformHypersonicImpl.java PlatformDefaultImpl.java PlatformDb2Impl.java Platform.java PlatformSapdbImpl.java PlatformInterbaseImpl.java PlatformOracleImpl.java PlatformCloudscapeImpl.java PlatformMysqlImpl.java
Date Thu, 04 Dec 2003 09:39:38 GMT
mpoeschl    2003/12/04 01:39:38

  Modified:    src/generator/src/java/org/apache/torque/engine/platform
                        PlatformPostgresqlImpl.java
                        PlatformHypersonicImpl.java
                        PlatformDefaultImpl.java PlatformDb2Impl.java
                        Platform.java PlatformSapdbImpl.java
                        PlatformInterbaseImpl.java PlatformOracleImpl.java
                        PlatformCloudscapeImpl.java PlatformMysqlImpl.java
  Log:
  add getAutoincrement()
  
  Revision  Changes    Path
  1.3       +10 -2     db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformPostgresqlImpl.java
  
  Index: PlatformPostgresqlImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformPostgresqlImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformPostgresqlImpl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformPostgresqlImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -101,7 +101,15 @@
        */
       public String getNativeIdMethod()
       {
  -        return "sequence";
  +        return Platform.SEQUENCE;
       }
   
  +    /**
  +     * @see Platform#getAutoIncrement()
  +     */
  +    public String getAutoIncrement()
  +    {
  +        return "SERIAL";
  +    }
  +    
   }
  
  
  
  1.3       +2 -1      db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformHypersonicImpl.java
  
  Index: PlatformHypersonicImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformHypersonicImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformHypersonicImpl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformHypersonicImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -83,4 +83,5 @@
           setSchemaDomainMapping(new Domain(SchemaType.LONGVARCHAR, "VARCHAR"));
           setSchemaDomainMapping(new Domain(SchemaType.VARBINARY, "BINARY"));
       }
  +
   }
  
  
  
  1.5       +10 -2     db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformDefaultImpl.java
  
  Index: PlatformDefaultImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformDefaultImpl.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- PlatformDefaultImpl.java	2 Dec 2003 02:27:22 -0000	1.4
  +++ PlatformDefaultImpl.java	4 Dec 2003 09:39:38 -0000	1.5
  @@ -110,7 +110,7 @@
        */
       public String getNativeIdMethod()
       {
  -        return "identity";
  +        return Platform.IDENTITY;
       }
   
       /**
  @@ -131,6 +131,14 @@
           // TODO: Check whether this is true for all DBs.  Also verify
           // the old Sybase templates.
           return (notNull ? "NOT NULL" : "");
  +    }
  +
  +    /**
  +     * @see Platform#getAutoIncrement()
  +     */
  +    public String getAutoIncrement()
  +    {
  +        return "IDENTITY";
       }
   
   }
  
  
  
  1.3       +9 -1      db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformDb2Impl.java
  
  Index: PlatformDb2Impl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformDb2Impl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformDb2Impl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformDb2Impl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -95,4 +95,12 @@
           return 18;
       }
   
  +    /**
  +     * @see Platform#getAutoIncrement()
  +     */
  +    public String getAutoIncrement()
  +    {
  +        return "GENERATED ALWAYS AS IDENTITY";
  +    }
  +    
   }
  
  
  
  1.5       +11 -1     db-torque/src/generator/src/java/org/apache/torque/engine/platform/Platform.java
  
  Index: Platform.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/Platform.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- Platform.java	2 Dec 2003 02:27:22 -0000	1.4
  +++ Platform.java	4 Dec 2003 09:39:38 -0000	1.5
  @@ -65,6 +65,11 @@
    */
   public interface Platform
   {
  +    /** constant for native id method */
  +    static final String IDENTITY = "identity";
  +    /** constant for native id method */
  +    static final String SEQUENCE = "sequence";
  +    
       /**
        * Returns the native IdMethod (sequence|identity)
        *
  @@ -93,4 +98,9 @@
        */
       String getNullString(boolean notNull);
   
  +    /**
  +     * @return The RDBMS-specific SQL fragment for autoincrement.
  +     */
  +    String getAutoIncrement();
  +    
   }
  
  
  
  1.3       +10 -2     db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformSapdbImpl.java
  
  Index: PlatformSapdbImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformSapdbImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformSapdbImpl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformSapdbImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -100,7 +100,15 @@
        */
       public String getNativeIdMethod()
       {
  -        return "sequence";
  +        return Platform.SEQUENCE;
       }
   
  +    /**
  +     * @see Platform#getAutoIncrement()
  +     */
  +    public String getAutoIncrement()
  +    {
  +        return "DEFAULT SERIAL";
  +    }
  +    
   }
  
  
  
  1.3       +2 -1      db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformInterbaseImpl.java
  
  Index: PlatformInterbaseImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformInterbaseImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformInterbaseImpl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformInterbaseImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -83,4 +83,5 @@
           setSchemaDomainMapping(new Domain(SchemaType.LONGVARCHAR, "VARCHAR"));
           setSchemaDomainMapping(new Domain(SchemaType.VARBINARY, "BLOB"));
       }
  +
   }
  
  
  
  1.3       +2 -2      db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformOracleImpl.java
  
  Index: PlatformOracleImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformOracleImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformOracleImpl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformOracleImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -109,7 +109,7 @@
        */
       public String getNativeIdMethod()
       {
  -        return "sequence";
  +        return Platform.SEQUENCE;
       }
   
   }
  
  
  
  1.3       +10 -1     db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformCloudscapeImpl.java
  
  Index: PlatformCloudscapeImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformCloudscapeImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformCloudscapeImpl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformCloudscapeImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -88,4 +88,13 @@
           setSchemaDomainMapping(new Domain(SchemaType.LONGVARBINARY, "LONG VARBINARY"));
           setSchemaDomainMapping(new Domain(SchemaType.JAVA_OBJECT, "SERIALIZE"));    
       }
  +
  +    /**
  +     * @see Platform#getAutoIncrement()
  +     */
  +    public String getAutoIncrement()
  +    {
  +        return "DEFAULT AUTOINCREMENT";
  +    }
  +    
   }
  
  
  
  1.3       +10 -2     db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java
  
  Index: PlatformMysqlImpl.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/platform/PlatformMysqlImpl.java,v
  retrieving revision 1.2
  retrieving revision 1.3
  diff -u -r1.2 -r1.3
  --- PlatformMysqlImpl.java	16 Nov 2003 20:16:53 -0000	1.2
  +++ PlatformMysqlImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  @@ -88,5 +88,13 @@
           setSchemaDomainMapping(new Domain(SchemaType.BLOB, "LONGBLOB"));
           setSchemaDomainMapping(new Domain(SchemaType.CLOB, "LONGTEXT"));
       }
  -    
  +
  +    /**
  +     * @see Platform#getAutoIncrement()
  +     */
  +    public String getAutoIncrement()
  +    {
  +        return "AUTO_INCREMENT";
  +    }
  +
   }
  
  
  

---------------------------------------------------------------------
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