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 PlatformDefaultImpl.java Platform.java PlatformMysqlImpl.java
Date Sat, 17 Jan 2004 01:51:33 GMT
mpoeschl    2004/01/16 17:51:33

  Modified:    src/generator/src/java/org/apache/torque/engine/platform
                        PlatformDefaultImpl.java Platform.java
                        PlatformMysqlImpl.java
  Log:
  use sql type (not SchemaType) in hasSize (as it depends on the sql type used by the db)
and implement it for mysql
  
  Revision  Changes    Path
  1.8       +4 -4      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.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- PlatformDefaultImpl.java	5 Dec 2003 18:35:52 -0000	1.7
  +++ PlatformDefaultImpl.java	17 Jan 2004 01:51:33 -0000	1.8
  @@ -3,7 +3,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -148,7 +148,7 @@
        * @see Platform#hasScale(String)
        * TODO collect info for all platforms
        */
  -    public boolean hasScale(SchemaType type)
  +    public boolean hasScale(String sqlType)
       {
           return true;
       }
  @@ -157,7 +157,7 @@
        * @see Platform#hasSize(String)
        * TODO collect info for all platforms
        */
  -    public boolean hasSize(SchemaType type)
  +    public boolean hasSize(String sqlType)
       {
           return true;
       }
  
  
  
  1.7       +5 -5      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.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- Platform.java	5 Dec 2003 18:35:52 -0000	1.6
  +++ Platform.java	17 Jan 2004 01:51:33 -0000	1.7
  @@ -106,16 +106,16 @@
       /**
        * Returns if the RDBMS-specific SQL type has a size attribute.
        * 
  -     * @param type the SchemaType
  +     * @param sqlType the SQL type
        * @return true if the type has a size attribute
        */
  -    boolean hasSize(SchemaType type);
  +    boolean hasSize(String sqlType);
       
       /**
        * Returns if the RDBMS-specific SQL type has a scale attribute.
        * 
  -     * @param type the SchemaType
  +     * @param sqlType the SQL type
        * @return true if the type has a scale attribute
        */
  -    boolean hasScale(SchemaType type);
  +    boolean hasScale(String sqlType);
   }
  
  
  
  1.4       +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.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- PlatformMysqlImpl.java	4 Dec 2003 09:39:38 -0000	1.3
  +++ PlatformMysqlImpl.java	17 Jan 2004 01:51:33 -0000	1.4
  @@ -3,7 +3,7 @@
   /* ====================================================================
    * The Apache Software License, Version 1.1
    *
  - * Copyright (c) 2003 The Apache Software Foundation.  All rights
  + * Copyright (c) 2003-2004 The Apache Software Foundation.  All rights
    * reserved.
    *
    * Redistribution and use in source and binary forms, with or without
  @@ -97,4 +97,12 @@
           return "AUTO_INCREMENT";
       }
   
  +    /**
  +     * @see Platform#hasSize(String)
  +     */
  +    public boolean hasSize(String sqlType) {
  +        return !("MEDIUMTEXT".equals(sqlType) || "LONGTEXT".equals(sqlType) 
  +                || "BLOB".equals(sqlType) || "MEDIUMBLOB".equals(sqlType)
  +                || "LONGBLOB".equals(sqlType));
  +    }
   }
  
  
  

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