jdk/src/share/classes/javax/sql/rowset/serial/SerialStruct.java
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 2 90ce3da70b43
child 6692 aef4e294026f
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     2
 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package javax.sql.rowset.serial;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import javax.sql.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.math.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.util.Vector;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
import javax.sql.rowset.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * A serialized mapping in the Java programming language of an SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * structured type. Each attribute that is not already serialized
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * is mapped to a serialized form, and if an attribute is itself
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * a structured type, each of its attributes that is not already
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * serialized is mapped to a serialized form.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * In addition, the structured type is custom mapped to a class in the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 * Java programming language if there is such a mapping, as are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
 * its attributes, if appropriate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 * The <code>SerialStruct</code> class provides a constructor for creating
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
 * an instance from a <code>Struct</code> object, a method for retrieving
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
 * the SQL type name of the SQL structured type in the database, and methods
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * for retrieving its attribute values.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
public class SerialStruct implements Struct, Serializable, Cloneable {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * The SQL type name for the structured type that this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * <code>SerialStruct</code> object represents.  This is the name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * used in the SQL definition of the SQL structured type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
    private String SQLTypeName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
     * An array of <code>Object</code> instances in  which each
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
     * element is an attribute of the SQL structured type that this
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
     * <code>SerialStruct</code> object represents.  The attributes are
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
     * ordered according to their order in the definition of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
     * SQL structured type.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
     * @serial
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
    private Object attribs[];
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     * Constructs a <code>SerialStruct</code> object from the given
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
     * <code>Struct</code> object, using the given <code>java.util.Map</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
     * object for custom mapping the SQL structured type or any of its
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
     * attributes that are SQL structured types.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
     * @param map a <code>java.util.Map</code> object in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
     *        each entry consists of 1) a <code>String</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     *        giving the fully qualified name of a UDT and 2) the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     *        <code>Class</code> object for the <code>SQLData</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     *        that defines how the UDT is to be mapped
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
     * @see java.sql.Struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
     public SerialStruct(Struct in, Map<String,Class<?>> map)
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
         throws SerialException
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
     {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
        // get the type name
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        SQLTypeName = new String(in.getSQLTypeName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
        System.out.println("SQLTypeName: " + SQLTypeName);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        // get the attributes of the struct
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        attribs = in.getAttributes(map);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
        /*
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
         * the array may contain further Structs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
         * and/or classes that have been mapped,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
         * other types that we have to serialize
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
         */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
        mapToSerial(map);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        } catch (SQLException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            throw new SerialException(e.getMessage());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
     /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
      * Constructs a <code>SerialStruct</code> object from the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
      * given <code>SQLData</code> object, using the given type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
      * map to custom map it to a class in the Java programming
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
      * language.  The type map gives the SQL type and the class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
      * to which it is mapped.  The <code>SQLData</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
      * defines the class to which the SQL type will be mapped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
      *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
      * @param in an instance of the <code>SQLData</code> class
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
      *           that defines the mapping of the SQL structured
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
      *           type to one or more objects in the Java programming language
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
      * @param map a <code>java.util.Map</code> object in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
      *        each entry consists of 1) a <code>String</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
      *        giving the fully qualified name of a UDT and 2) the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
      *        <code>Class</code> object for the <code>SQLData</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
      *        that defines how the UDT is to be mapped
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
      * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
      */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    public SerialStruct(SQLData in, Map<String,Class<?>> map)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
        throws SerialException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        //set the type name
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
        SQLTypeName = new String(in.getSQLTypeName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
        Vector tmp = new Vector();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        in.writeSQL(new SQLOutputImpl(tmp, map));
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        attribs = tmp.toArray();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
        } catch (SQLException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            throw new SerialException(e.getMessage());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     * Retrieves the SQL type name for this <code>SerialStruct</code>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
     * object. This is the name used in the SQL definition of the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
     * structured type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * @return a <code>String</code> object representing the SQL
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     *         type name for the SQL structured type that this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     *         <code>SerialStruct</code> object represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
    public String getSQLTypeName() throws SerialException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        return SQLTypeName;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
     * Retrieves an array of <code>Object</code> values containing the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
     * attributes of the SQL structured type that this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
     * <code>SerialStruct</code> object represents.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
     * @return an array of <code>Object</code> values, with each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     *         element being an attribute of the SQL structured type
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     *         that this <code>SerialStruct</code> object represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    public Object[]  getAttributes() throws SerialException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        return attribs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
     * Retrieves the attributes for the SQL structured type that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * this <code>SerialStruct</code> represents as an array of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     * <code>Object</code> values, using the given type map for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * custom mapping if appropriate.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * @param map a <code>java.util.Map</code> object in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *        each entry consists of 1) a <code>String</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     *        giving the fully qualified name of a UDT and 2) the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     *        <code>Class</code> object for the <code>SQLData</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     *        that defines how the UDT is to be mapped
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     * @return an array of <code>Object</code> values, with each
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     *         element being an attribute of the SQL structured
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     *         type that this <code>SerialStruct</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     *         represents
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
    public Object[] getAttributes(Map<String,Class<?>> map)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
        throws SerialException
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
    {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
       return attribs;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     * Maps attributes of an SQL structured type that are not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
     * serialized to a serialized form, using the given type map
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
     * for custom mapping when appropriate.  The following types
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * in the Java programming language are mapped to their
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * serialized forms:  <code>Struct</code>, <code>SQLData</code>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
     * <code>Ref</code>, <code>Blob</code>, <code>Clob</code>, and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * <code>Array</code>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * <P>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     * This method is called internally and is not used by an
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * application programmer.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * @param map a <code>java.util.Map</code> object in which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     *        each entry consists of 1) a <code>String</code> object
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     *        giving the fully qualified name of a UDT and 2) the
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
     *        <code>Class</code> object for the <code>SQLData</code> implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     *        that defines how the UDT is to be mapped
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * @throws SerialException if an error occurs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    private void mapToSerial(Map map) throws SerialException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
        for (int i = 0; i < attribs.length; i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
            if (attribs[i] instanceof Struct) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
                attribs[i] = new SerialStruct((Struct)attribs[i], map);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
            } else if (attribs[i] instanceof SQLData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
                attribs[i] = new SerialStruct((SQLData)attribs[i], map);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
            } else if (attribs[i] instanceof Blob) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
                attribs[i] = new SerialBlob((Blob)attribs[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
            } else if (attribs[i] instanceof Clob) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
                attribs[i] = new SerialClob((Clob)attribs[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
            } else if (attribs[i] instanceof Ref) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
                attribs[i] = new SerialRef((Ref)attribs[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
            } else if (attribs[i] instanceof java.sql.Array) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
                attribs[i] = new SerialArray((java.sql.Array)attribs[i], map);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
        } catch (SQLException e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
            throw new SerialException(e.getMessage());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
        return;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
         * The identifier that assists in the serialization of this
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
     * <code>SerialStruct</code> object.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
    static final long serialVersionUID = -8322445504027483372L;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
}