db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From t...@apache.org
Subject cvs commit: db-ojb/src/java/org/apache/ojb/broker/metadata FieldDescriptor.java
Date Fri, 04 Apr 2003 19:15:55 GMT
thma        2003/04/04 11:15:55

  Modified:    src/java/org/apache/ojb/broker/util SqlHelper.java
               src/java/org/apache/ojb/broker/metadata FieldDescriptor.java
  Log:
  add support for JDBC STRUCT thanks to a patch by Per Olof Noren
  
  Revision  Changes    Path
  1.7       +22 -1     db-ojb/src/java/org/apache/ojb/broker/util/SqlHelper.java
  
  Index: SqlHelper.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/util/SqlHelper.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- SqlHelper.java	31 Jan 2003 17:55:55 -0000	1.6
  +++ SqlHelper.java	4 Apr 2003 19:15:55 -0000	1.7
  @@ -282,6 +282,13 @@
                       result = ( rs.wasNull() ? null : aBlob.getBytes(1L, (int) aBlob.length())
);
                       break;
                   }
  +             case Types.STRUCT:
  +                 {
  +                     java.sql.Struct aStruct = (java.sql.Struct) rs.getObject(columnId);
  +                     result = ( rs.wasNull() ? null : aStruct );
  +                     break;
  +                 }
  +
               default :
                   {
                       throw new OJBRuntimeException(
  @@ -424,6 +431,12 @@
                       result = ( rs.wasNull() ? null : aBlob.getBytes(1L, (int) aBlob.length())
);
                       break;
                   }
  +             case Types.STRUCT:
  +                 {
  +                     java.sql.Struct aStruct = (java.sql.Struct) rs.getObject(columnId);
  +                     result = ( rs.wasNull() ? null : aStruct );
  +                     break;
  +                 }               
               default :
                   {
                       throw new OJBRuntimeException(
  @@ -553,6 +566,10 @@
           {
               return Types.BIT;
           }
  +        else if (value instanceof java.sql.Struct)
  +        {
  +            return Types.STRUCT;
  +        }
           else
           {
               return Types.OTHER;
  @@ -650,6 +667,10 @@
                   {
                       return "Types.BLOB";
                   }
  +            case Types.STRUCT :
  +                {
  +                    return "Types.STRUCT";
  +                }               
               default :
                   {
                       return "UNKOWN Type";
  
  
  
  1.20      +2 -0      db-ojb/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java
  
  Index: FieldDescriptor.java
  ===================================================================
  RCS file: /home/cvs/db-ojb/src/java/org/apache/ojb/broker/metadata/FieldDescriptor.java,v
  retrieving revision 1.19
  retrieving revision 1.20
  diff -u -r1.19 -r1.20
  --- FieldDescriptor.java	3 Apr 2003 20:35:27 -0000	1.19
  +++ FieldDescriptor.java	4 Apr 2003 19:15:55 -0000	1.20
  @@ -260,6 +260,8 @@
               result = Types.CLOB;
           else if (type.equals("blob"))
               result = Types.BLOB;
  +        else if (type.equals("struct"))
  +            result = Types.STRUCT;
           else
               throw new OJBRuntimeException(
                       "The type "
  
  
  

Mime
View raw message