- 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 aStruct
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:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SerialStruct(SQLData in, Map<String,Class<?>> map)
Constructs aSerialStruct
object from the givenSQLData
object, 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 aSerialStruct
object from the givenStruct
object, using the givenjava.util.Map
object for custom mapping the SQL structured type or any of its attributes that are SQL structured types.
-
Method Summary
Methods Modifier and Type Method and Description Object[]
getAttributes()
Retrieves an array ofObject
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 thisSerialStruct
represents as an array ofObject
values, using the given type map for custom mapping if appropriate.String
getSQLTypeName()
Retrieves the SQL type name for thisSerialStruct
object.
-
-
-
Constructor Detail
-
SerialStruct
public SerialStruct(Struct in, Map<String,Class<?>> map) throws SerialException
Constructs aSerialStruct
object from the givenStruct
object, using the givenjava.util.Map
object for custom mapping the SQL structured type or any of its attributes that are SQL structured types.- Parameters:
map
- ajava.util.Map
object in which each entry consists of 1) aString
object giving the fully qualified name of a UDT and 2) theClass
object for theSQLData
implementation that defines how the UDT is to be mapped- Throws:
SerialException
- if an error occurs- See Also:
Struct
-
SerialStruct
public SerialStruct(SQLData in, Map<String,Class<?>> map) throws SerialException
Constructs aSerialStruct
object from the givenSQLData
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. TheSQLData
object defines the class to which the SQL type will be mapped.- Parameters:
in
- an instance of theSQLData
class that defines the mapping of the SQL structured type to one or more objects in the Java programming languagemap
- ajava.util.Map
object in which each entry consists of 1) aString
object giving the fully qualified name of a UDT and 2) theClass
object for theSQLData
implementation that defines how the UDT is to be mapped- Throws:
SerialException
- if an error occurs
-
-
Method Detail
-
getSQLTypeName
public String getSQLTypeName() throws SerialException
Retrieves the SQL type name for thisSerialStruct
object. This is the name used in the SQL definition of the structured type- Specified by:
getSQLTypeName
in interfaceStruct
- Returns:
- a
String
object representing the SQL type name for the SQL structured type that thisSerialStruct
object represents - Throws:
SerialException
- if an error occurs
-
getAttributes
public Object[] getAttributes() throws SerialException
Retrieves an array ofObject
values containing the attributes of the SQL structured type that thisSerialStruct
object represents.- Specified by:
getAttributes
in interfaceStruct
- Returns:
- an array of
Object
values, with each element being an attribute of the SQL structured type that thisSerialStruct
object represents - Throws:
SerialException
- if an error occurs
-
getAttributes
public Object[] getAttributes(Map<String,Class<?>> map) throws SerialException
Retrieves the attributes for the SQL structured type that thisSerialStruct
represents as an array ofObject
values, using the given type map for custom mapping if appropriate.- Specified by:
getAttributes
in interfaceStruct
- Parameters:
map
- ajava.util.Map
object in which each entry consists of 1) aString
object giving the fully qualified name of a UDT and 2) theClass
object for theSQLData
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 thisSerialStruct
object represents - Throws:
SerialException
- if an error occurs
-
-
Traduction non disponible
Les API Java ne sont pas encore traduites en français sur l'infobrol. Seule la version anglaise est disponible pour l'instant.
Version en cache
22/12/2024 15:06:36 Cette version de la page est en cache (à la date du 22/12/2024 15:06:36) afin d'accélérer le traitement. Vous pouvez activer le mode utilisateur dans le menu en haut pour afficher la dernère version de la page.Document créé le 01/09/2006, dernière modification le 04/03/2020
Source du document imprimé : https://www.gaudry.be/java-api-rf-javax/sql/rowset/serial/serialstruct.html
L'infobrol est un site personnel dont le contenu n'engage que moi. Le texte est mis à disposition sous licence CreativeCommons(BY-NC-SA). Plus d'info sur les conditions d'utilisation et sur l'auteur.
Références
Ces références et liens indiquent des documents consultés lors de la rédaction de cette page, ou qui peuvent apporter un complément d'information, mais les auteurs de ces sources ne peuvent être tenus responsables du contenu de cette page.
L'auteur de ce site est seul responsable de la manière dont sont présentés ici les différents concepts, et des libertés qui sont prises avec les ouvrages de référence. N'oubliez pas que vous devez croiser les informations de sources multiples afin de diminuer les risques d'erreurs.