- java.lang.Object
- 
- javax.sql.rowset.serial.SerialStruct
 
- 
- All Implemented Interfaces:
- Serializable,- Cloneable,- Struct
 
 public class SerialStruct extends Object implements Struct, Serializable, Cloneable A serialized mapping in the Java programming language of an SQL structured type. Each attribute that is not already serialized is mapped to a serialized form, and if an attribute is itself a structured type, each of its attributes that is not already serialized is mapped to a serialized form.In addition, the structured type is custom mapped to a class in the Java programming language if there is such a mapping, as are its attributes, if appropriate. The SerialStructclass provides a constructor for creating an instance from aStructobject, a method for retrieving the SQL type name of the SQL structured type in the database, and methods for retrieving its attribute values.Thread safetyA SerialStruct is not safe for use by multiple concurrent threads. If a SerialStruct is to be used by more than one thread then access to the SerialStruct should be controlled by appropriate synchronization.- Since:
- 1.5
- See Also:
- Serialized Form
 
- 
- 
Constructor SummaryConstructors Constructor Description SerialStruct(SQLData in, Map<String,Class<?>> map)Constructs aSerialStructobject from the givenSQLDataobject, using the given type map to custom map it to a class in the Java programming language.SerialStruct(Struct in, Map<String,Class<?>> map)Constructs aSerialStructobject from the givenStructobject, using the givenjava.util.Mapobject for custom mapping the SQL structured type or any of its attributes that are SQL structured types.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a clone of thisSerialStruct.booleanequals(Object obj)Compares this SerialStruct to the specified object.Object[]getAttributes()Retrieves an array ofObjectvalues containing the attributes of the SQL structured type that thisSerialStructobject represents.Object[]getAttributes(Map<String,Class<?>> map)Retrieves the attributes for the SQL structured type that thisSerialStructrepresents as an array ofObjectvalues, using the given type map for custom mapping if appropriate.StringgetSQLTypeName()Retrieves the SQL type name for thisSerialStructobject.inthashCode()Returns a hash code for thisSerialStruct.
 
- 
- 
- 
Constructor Detail- 
SerialStructpublic SerialStruct(Struct in, Map<String,Class<?>> map) throws SerialException Constructs aSerialStructobject from the givenStructobject, using the givenjava.util.Mapobject for custom mapping the SQL structured type or any of its attributes that are SQL structured types.- Parameters:
- in- an instance of- Struct
- map- a- java.util.Mapobject in which each entry consists of 1) a- Stringobject giving the fully qualified name of a UDT and 2) the- Classobject for the- SQLDataimplementation that defines how the UDT is to be mapped
- Throws:
- SerialException- if an error occurs
- See Also:
- Struct
 
 - 
SerialStructpublic SerialStruct(SQLData in, Map<String,Class<?>> map) throws SerialException Constructs aSerialStructobject from the givenSQLDataobject, using the given type map to custom map it to a class in the Java programming language. The type map gives the SQL type and the class to which it is mapped. TheSQLDataobject defines the class to which the SQL type will be mapped.- Parameters:
- in- an instance of the- SQLDataclass that defines the mapping of the SQL structured type to one or more objects in the Java programming language
- map- a- java.util.Mapobject in which each entry consists of 1) a- Stringobject giving the fully qualified name of a UDT and 2) the- Classobject for the- SQLDataimplementation that defines how the UDT is to be mapped
- Throws:
- SerialException- if an error occurs
 
 
- 
 - 
Method Detail- 
getSQLTypeNamepublic String getSQLTypeName() throws SerialException Retrieves the SQL type name for thisSerialStructobject. This is the name used in the SQL definition of the structured type- Specified by:
- getSQLTypeNamein interface- Struct
- Returns:
- a Stringobject representing the SQL type name for the SQL structured type that thisSerialStructobject represents
- Throws:
- SerialException- if an error occurs
 
 - 
getAttributespublic Object[] getAttributes() throws SerialException Retrieves an array ofObjectvalues containing the attributes of the SQL structured type that thisSerialStructobject represents.- Specified by:
- getAttributesin interface- Struct
- Returns:
- an array of Objectvalues, with each element being an attribute of the SQL structured type that thisSerialStructobject represents
- Throws:
- SerialException- if an error occurs
 
 - 
getAttributespublic Object[] getAttributes(Map<String,Class<?>> map) throws SerialException Retrieves the attributes for the SQL structured type that thisSerialStructrepresents as an array ofObjectvalues, using the given type map for custom mapping if appropriate.- Specified by:
- getAttributesin interface- Struct
- Parameters:
- map- a- java.util.Mapobject in which each entry consists of 1) a- Stringobject giving the fully qualified name of a UDT and 2) the- Classobject for the- SQLDataimplementation that defines how the UDT is to be mapped
- Returns:
- an array of Objectvalues, with each element being an attribute of the SQL structured type that thisSerialStructobject represents
- Throws:
- SerialException- if an error occurs
 
 - 
equalspublic boolean equals(Object obj) Compares this SerialStruct to the specified object. The result istrueif and only if the argument is notnulland is aSerialStructobject whose attributes are identical to this object's attributes- Overrides:
- equalsin class- Object
- Parameters:
- obj- The object to compare this- SerialStructagainst
- Returns:
- trueif the given object represents a- SerialStructequivalent to this SerialStruct,- falseotherwise
- See Also:
- Object.hashCode(),- HashMap
 
 - 
hashCodepublic int hashCode() Returns a hash code for thisSerialStruct. The hash code for aSerialStructobject is computed using the hash codes of the attributes of theSerialStructobject and itsSQLTypeName- Overrides:
- hashCodein class- Object
- Returns:
- a hash code value for this object.
- See Also:
- Object.equals(java.lang.Object),- System.identityHashCode(java.lang.Object)
 
 - 
clonepublic Object clone() Returns a clone of thisSerialStruct. The copy will contain a reference to a clone of the underlying attribs array, not a reference to the original underlying attribs array of thisSerialStructobject.
 
- 
 
-