SerialStruct (Java Platform SE 6) (original) (raw)
javax.sql.rowset.serial
Class SerialStruct
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 SerialStruct
class provides a constructor for creating an instance from a Struct
object, a method for retrieving the SQL type name of the SQL structured type in the database, and methods for retrieving its attribute values.
See Also:
Constructor Summary |
---|
[SerialStruct](../../../../javax/sql/rowset/serial/SerialStruct.html#SerialStruct%28java.sql.SQLData, java.util.Map%29)(SQLData in,Map<String,Class<?>> map) Constructs a SerialStruct object from the given SQLData object, using the given type map to custom map it to a class in the Java programming language. |
[SerialStruct](../../../../javax/sql/rowset/serial/SerialStruct.html#SerialStruct%28java.sql.Struct, java.util.Map%29)(Struct in,Map<String,Class<?>> map) Constructs a SerialStruct object from the givenStruct object, using the given java.util.Map object for custom mapping the SQL structured type or any of its attributes that are SQL structured types. |
Method Summary | |
---|---|
Object[] | getAttributes() Retrieves an array of Object values containing the attributes of the SQL structured type that thisSerialStruct object represents. |
Object[] | getAttributes(Map<String,Class<?>> map) Retrieves the attributes for the SQL structured type that this SerialStruct represents as an array of Object values, using the given type map for custom mapping if appropriate. |
String | getSQLTypeName() Retrieves the SQL type name for this SerialStruct object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, [wait](../../../../java/lang/Object.html#wait%28long, int%29) |
Constructor Detail |
---|
SerialStruct
public SerialStruct(Struct in, Map<String,Class<?>> map) throws SerialException
Constructs a SerialStruct
object from the givenStruct
object, using the given java.util.Map
object for custom mapping the SQL structured type or any of its attributes that are SQL structured types.
Parameters:
map
- a java.util.Map
object in which each entry consists of 1) a String
object giving the fully qualified name of a UDT and 2) theClass
object for the SQLData
implementation that defines how the UDT is to be mapped
Throws:
[SerialException](../../../../javax/sql/rowset/serial/SerialException.html "class in javax.sql.rowset.serial")
- if an error occurs
See Also:
SerialStruct
public SerialStruct(SQLData in, Map<String,Class<?>> map) throws SerialException
Constructs a SerialStruct
object from the given SQLData
object, 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. The SQLData
object defines the class to which the SQL type will be mapped.
Parameters:
in
- an instance of the SQLData
class that defines the mapping of the SQL structured type to one or more objects in the Java programming language
map
- a java.util.Map
object in which each entry consists of 1) a String
object giving the fully qualified name of a UDT and 2) theClass
object for the SQLData
implementation that defines how the UDT is to be mapped
Throws:
[SerialException](../../../../javax/sql/rowset/serial/SerialException.html "class in javax.sql.rowset.serial")
- if an error occurs
Method Detail |
---|
getSQLTypeName
public String getSQLTypeName() throws SerialException
Retrieves the SQL type name for this SerialStruct
object. This is the name used in the SQL definition of the structured type
Specified by:
[getSQLTypeName](../../../../java/sql/Struct.html#getSQLTypeName%28%29)
in interface [Struct](../../../../java/sql/Struct.html "interface in java.sql")
Returns:
a String
object representing the SQL type name for the SQL structured type that thisSerialStruct
object represents
Throws:
[SerialException](../../../../javax/sql/rowset/serial/SerialException.html "class in javax.sql.rowset.serial")
- if an error occurs
getAttributes
public Object[] getAttributes() throws SerialException
Retrieves an array of Object
values containing the attributes of the SQL structured type that thisSerialStruct
object represents.
Specified by:
[getAttributes](../../../../java/sql/Struct.html#getAttributes%28%29)
in interface [Struct](../../../../java/sql/Struct.html "interface in java.sql")
Returns:
an array of Object
values, with each element being an attribute of the SQL structured type that this SerialStruct
object represents
Throws:
[SerialException](../../../../javax/sql/rowset/serial/SerialException.html "class in javax.sql.rowset.serial")
- if an error occurs
getAttributes
public Object[] getAttributes(Map<String,Class<?>> map) throws SerialException
Retrieves the attributes for the SQL structured type that this SerialStruct
represents as an array of Object
values, using the given type map for custom mapping if appropriate.
Specified by:
[getAttributes](../../../../java/sql/Struct.html#getAttributes%28java.util.Map%29)
in interface [Struct](../../../../java/sql/Struct.html "interface in java.sql")
Parameters:
map
- a java.util.Map
object in which each entry consists of 1) a String
object giving the fully qualified name of a UDT and 2) theClass
object for the SQLData
implementation that defines how the UDT is to be mapped
Returns:
an array of Object
values, with each element being an attribute of the SQL structured type that this SerialStruct
object represents
Throws:
[SerialException](../../../../javax/sql/rowset/serial/SerialException.html "class in javax.sql.rowset.serial")
- if an error occurs
Submit a bug or feature
For further API reference and developer documentation, see Java SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2015, Oracle and/or its affiliates. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
Scripting on this page tracks web page traffic, but does not change the content in any way.