src/share/classes/javax/sql/rowset/serial/SerialStruct.java

Print this page


   1 /*
   2  * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  34 import java.util.Vector;
  35 
  36 import javax.sql.rowset.*;
  37 
  38 /**
  39  * A serialized mapping in the Java programming language of an SQL
  40  * structured type. Each attribute that is not already serialized
  41  * is mapped to a serialized form, and if an attribute is itself
  42  * a structured type, each of its attributes that is not already
  43  * serialized is mapped to a serialized form.
  44  * <P>
  45  * In addition, the structured type is custom mapped to a class in the
  46  * Java programming language if there is such a mapping, as are
  47  * its attributes, if appropriate.
  48  * <P>
  49  * The <code>SerialStruct</code> class provides a constructor for creating
  50  * an instance from a <code>Struct</code> object, a method for retrieving
  51  * the SQL type name of the SQL structured type in the database, and methods
  52  * for retrieving its attribute values.
  53  *
  54  * <h4> Thread safety </h4>
  55  *
  56  * A SerialStruct is not safe for use by multiple concurrent threads.  If a
  57  * SerialStruct is to be used by more than one thread then access to the
  58  * SerialStruct should be controlled by appropriate synchronization.
  59  *
  60  */
  61 public class SerialStruct implements Struct, Serializable, Cloneable {
  62 
  63 
  64     /**
  65      * The SQL type name for the structured type that this
  66      * <code>SerialStruct</code> object represents.  This is the name
  67      * used in the SQL definition of the SQL structured type.
  68      *
  69      * @serial
  70      */
  71     private String SQLTypeName;
  72 
  73     /**
  74      * An array of <code>Object</code> instances in  which each


   1 /*
   2  * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  34 import java.util.Vector;
  35 
  36 import javax.sql.rowset.*;
  37 
  38 /**
  39  * A serialized mapping in the Java programming language of an SQL
  40  * structured type. Each attribute that is not already serialized
  41  * is mapped to a serialized form, and if an attribute is itself
  42  * a structured type, each of its attributes that is not already
  43  * serialized is mapped to a serialized form.
  44  * <P>
  45  * In addition, the structured type is custom mapped to a class in the
  46  * Java programming language if there is such a mapping, as are
  47  * its attributes, if appropriate.
  48  * <P>
  49  * The <code>SerialStruct</code> class provides a constructor for creating
  50  * an instance from a <code>Struct</code> object, a method for retrieving
  51  * the SQL type name of the SQL structured type in the database, and methods
  52  * for retrieving its attribute values.
  53  *
  54  * <h3> Thread safety </h3>
  55  *
  56  * A SerialStruct is not safe for use by multiple concurrent threads.  If a
  57  * SerialStruct is to be used by more than one thread then access to the
  58  * SerialStruct should be controlled by appropriate synchronization.
  59  *
  60  */
  61 public class SerialStruct implements Struct, Serializable, Cloneable {
  62 
  63 
  64     /**
  65      * The SQL type name for the structured type that this
  66      * <code>SerialStruct</code> object represents.  This is the name
  67      * used in the SQL definition of the SQL structured type.
  68      *
  69      * @serial
  70      */
  71     private String SQLTypeName;
  72 
  73     /**
  74      * An array of <code>Object</code> instances in  which each