db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From arm...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/util SqlTypeHelper.java
Date Mon, 10 Nov 2003 23:58:14 GMT
arminw      2003/11/10 15:58:14

  Modified:    src/java/org/apache/ojb/broker/util SqlTypeHelper.java
  Log:
  minor improvement, change order of types.
  Most requested first.
  
  Revision  Changes    Path
  1.4       +38 -38    db-ojb/src/java/org/apache/ojb/broker/util/SqlTypeHelper.java
  
  Index: SqlTypeHelper.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/SqlTypeHelper.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- SqlTypeHelper.java	24 Sep 2003 19:36:41 -0000	1.3
  +++ SqlTypeHelper.java	10 Nov 2003 23:58:14 -0000	1.4
  @@ -210,100 +210,100 @@
           Object result = null;
           switch (jdbcType)
           {
  -            case Types.ARRAY :
  +            case Types.BIGINT :
                   {
  -                    Object[] arr = { identifier.toString()};
  -                    result = arr;
  +                    result = identifier;
                       break;
                   }
  -            case Types.BIGINT :
  +            case Types.DECIMAL :
                   {
  -                    result = identifier;
  +                    result = new BigDecimal(identifier.longValue());
                       break;
                   }
  -            case Types.BINARY :
  +            case Types.NUMERIC :
                   {
  -                    result = identifier.toString().getBytes();
  +                    result = new BigDecimal(identifier.longValue());
                       break;
                   }
  -            case Types.CHAR :
  +            case Types.INTEGER :
                   {
  -                    result = identifier.toString();
  +                    result = new Integer(identifier.intValue());
                       break;
                   }
  -            case Types.DATE :
  +            case Types.REAL :
                   {
  -                    result = new Date(identifier.longValue());
  +                    result = new Float(identifier.floatValue());
                       break;
                   }
  -            case Types.DECIMAL :
  +            case Types.SMALLINT :
                   {
  -                    result = new BigDecimal(identifier.longValue());
  +                    result = new Short(identifier.shortValue());
                       break;
                   }
  -            case Types.DOUBLE :
  +            case Types.TIME :
                   {
  -                    result = new Double(identifier.doubleValue());
  +                    result = new Time(identifier.longValue());
                       break;
                   }
  -            case Types.FLOAT :
  +            case Types.TIMESTAMP :
                   {
  -                    result = new Double(identifier.doubleValue());
  +                    result = new Timestamp(identifier.longValue());
                       break;
                   }
  -            case Types.INTEGER :
  +            case Types.DATE :
                   {
  -                    result = new Integer(identifier.intValue());
  +                    result = new Date(identifier.longValue());
                       break;
                   }
  -            case Types.LONGVARBINARY :
  +            case Types.TINYINT :
                   {
  -                    result = identifier.toString().getBytes();
  +                    result = new Byte(identifier.byteValue());
                       break;
                   }
  -            case Types.LONGVARCHAR :
  +            case Types.VARCHAR :
                   {
                       result = identifier.toString();
                       break;
                   }
  -            case Types.NUMERIC :
  +            case Types.CHAR :
                   {
  -                    result = new BigDecimal(identifier.longValue());
  +                    result = identifier.toString();
                       break;
                   }
  -            case Types.REAL :
  +            case Types.DOUBLE :
                   {
  -                    result = new Float(identifier.floatValue());
  +                    result = new Double(identifier.doubleValue());
                       break;
                   }
  -            case Types.SMALLINT :
  +            case Types.FLOAT :
                   {
  -                    result = new Short(identifier.shortValue());
  +                    result = new Double(identifier.doubleValue());
                       break;
                   }
  -            case Types.TIME :
  +            case Types.LONGVARBINARY :
                   {
  -                    result = new Time(identifier.longValue());
  +                    result = identifier.toString().getBytes();
                       break;
                   }
  -            case Types.TIMESTAMP :
  +            case Types.LONGVARCHAR :
                   {
  -                    result = new Timestamp(identifier.longValue());
  +                    result = identifier.toString();
                       break;
                   }
  -            case Types.TINYINT :
  +            case Types.VARBINARY :
                   {
  -                    result = new Byte(identifier.byteValue());
  +                    result = identifier.toString().getBytes();
                       break;
                   }
  -            case Types.VARBINARY :
  +            case Types.BINARY :
                   {
                       result = identifier.toString().getBytes();
                       break;
                   }
  -            case Types.VARCHAR :
  +            case Types.ARRAY :
                   {
  -                    result = identifier.toString();
  +                    Object[] arr = { identifier.toString()};
  +                    result = arr;
                       break;
                   }
               default :
  
  
  

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


Mime
View raw message