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 TypeMap.java
Date Fri, 05 Dec 2003 15:57:25 GMT
mpoeschl    2003/12/05 07:57:25

  Modified:    src/generator/src/java/org/apache/torque/engine/database/model
                        TypeMap.java
  Log:
  use VARCHAR if the jdbc type is unknown (to get a incorrect schema.xml is better as to get
no schema.xml)
  
  Revision  Changes    Path
  1.5       +15 -3     db-torque/src/generator/src/java/org/apache/torque/engine/database/model/TypeMap.java
  
  Index: TypeMap.java
  ===================================================================
  RCS file: /home/cvs/db-torque/src/generator/src/java/org/apache/torque/engine/database/model/TypeMap.java,v
  retrieving revision 1.4
  retrieving revision 1.5
  diff -u -r1.4 -r1.5
  --- TypeMap.java	5 Dec 2003 14:28:28 -0000	1.4
  +++ TypeMap.java	5 Dec 2003 15:57:25 -0000	1.5
  @@ -54,9 +54,12 @@
    * <http://www.apache.org/>.
    */
   
  +import java.sql.Types;
   import java.util.Hashtable;
   import java.util.Iterator;
  -import java.sql.Types;
  +
  +import org.apache.commons.logging.Log;
  +import org.apache.commons.logging.LogFactory;
   
   // I don't know if the peer system deals
   // with the recommended mappings.
  @@ -110,6 +113,9 @@
    */
   public class TypeMap
   {
  +    /** Logging class from commons.logging */
  +    private static Log log = LogFactory.getLog(Column.class);
  +    
       private static final SchemaType[] TEXT_TYPES =
       {
           SchemaType.CHAR, SchemaType.VARCHAR, SchemaType.LONGVARCHAR, 
  @@ -586,7 +592,13 @@
           {
               initialize();
           }
  -        return (SchemaType) jdbcToTorqueTypeMap.get(sqlType);
  +        SchemaType st = (SchemaType) jdbcToTorqueTypeMap.get(sqlType);
  +        if (st == null)
  +        {
  +            log.warn("SchemaType for JdbcType " + sqlType + " is not defined");
  +            st = SchemaType.VARCHAR;
  +        }
  +        return st;
       }
   
       /**
  
  
  

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