APIdia Launch Partner
Top Description Fields Constructors Methods
javax.sql.rowset.serial

public Class SerialRef

extends Object
implements Ref, Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable, java.sql.Ref
Imports
java.sql.*, java.io.*, java.util.*

A serialized mapping of a Ref object, which is the mapping in the Java programming language of an SQL REF value.

The SerialRef class provides a constructor for creating a SerialRef instance from a Ref object and provides methods for getting and setting the Ref object.

Thread safety

A SerialRef is not safe for use by multiple concurrent threads. If a SerialRef is to be used by more than one thread then access to the SerialRef should be controlled by appropriate synchronization.
Since
1.5

Field Summary

Modifier and TypeField and Description
private String
baseTypeName

String containing the base type name.

private Object
private Ref
pack-priv static final long
serialVersionUID

The identifier that assists in the serialization of this SerialRef object.

Constructor Summary

AccessConstructor and Description
public
SerialRef(Ref
a Ref object; cannot be null
ref
)

Constructs a SerialRef object from the given Ref object.

Method Summary

Modifier and TypeMethod and Description
public Object

Returns:

a clone of this SerialRef
clone
()

Overrides java.lang.Object.clone.

Returns a clone of this SerialRef.

public boolean

Returns:

true if the given object represents a SerialRef equivalent to this SerialRef, false otherwise
equals
(Object
The object to compare this SerialRef against
obj
)

Overrides java.lang.Object.equals.

Compares this SerialRef to the specified object.

public String

Returns:

a string of the base type name of the Ref
getBaseTypeName
()

Implements java.sql.Ref.getBaseTypeName.

Returns a string describing the base type name of the Ref.

public Object

Returns:

an object instance resolved from the Ref reference and mapped according to the supplied type map
getObject
(Map<String, Class<?>>
a java.util.Map object containing zero or more entries, with each entry consisting of 1) a String giving the fully qualified name of a UDT and 2) the Class object for the SQLData implementation that defines how the UDT is to be mapped
map
)

Implements java.sql.Ref.getObject.

Returns an Object representing the SQL structured type to which this SerialRef object refers.

public Object

Returns:

an object instance resolved from the Ref reference
getObject
()

Implements java.sql.Ref.getObject.

Returns an Object representing the SQL structured type to which this SerialRef object refers.

public int

Returns:

a hash code value for this object.
hashCode
()

Overrides java.lang.Object.hashCode.

Returns a hash code for this SerialRef.

private void
readObject(ObjectInputStream
the ObjectInputStream to read from.
s
)

readObject is called to restore the state of the SerialRef from a stream.

public void
setObject(Object
an Object representing the SQL structured type to be referenced
obj
)

Implements java.sql.Ref.setObject.

Sets the SQL structured type that this SerialRef object references to the given Object object.

private void
writeObject(ObjectOutputStream
the ObjectOutputStream to write to.
s
)

writeObject is called to save the state of the SerialRef to a stream.

Inherited from java.lang.Object:
finalizegetClassnotifynotifyAlltoStringwaitwaitwait

Field Detail

baseTypeNameback to summary
private String baseTypeName

String containing the base type name.

objectback to summary
private Object object
Annotations
@SuppressWarnings:serial
referenceback to summary
private Ref reference
Annotations
@SuppressWarnings:serial
serialVersionUIDback to summary
pack-priv static final long serialVersionUID

The identifier that assists in the serialization of this SerialRef object.

Constructor Detail

SerialRefback to summary
public SerialRef(Ref ref) throws SerialException, SQLException

Constructs a SerialRef object from the given Ref object.

Parameters
ref:Ref

a Ref object; cannot be null

Exceptions
SerialException:
if an error occurs serializing the Ref object
SQLException:
if a database access occurs; if ref is null; or if the Ref object returns a null value base type name.

Method Detail

cloneback to summary
public Object clone()

Overrides java.lang.Object.clone.

Returns a clone of this SerialRef. The underlying Ref object will be set to null.

Returns:Object

a clone of this SerialRef

equalsback to summary
public boolean equals(Object obj)

Overrides java.lang.Object.equals.

Compares this SerialRef to the specified object. The result is true if and only if the argument is not null and is a SerialRef object that represents the same object as this object.

Parameters
obj:Object

The object to compare this SerialRef against

Returns:boolean

true if the given object represents a SerialRef equivalent to this SerialRef, false otherwise

getBaseTypeNameback to summary
public String getBaseTypeName() throws SerialException

Implements java.sql.Ref.getBaseTypeName.

Returns a string describing the base type name of the Ref.

Returns:String

a string of the base type name of the Ref

Exceptions
SerialException:
in no Ref object has been set
getObjectback to summary
public Object getObject(Map<String, Class<?>> map) throws SerialException

Implements java.sql.Ref.getObject.

Returns an Object representing the SQL structured type to which this SerialRef object refers. The attributes of the structured type are mapped according to the given type map.

Parameters
map:Map<String, Class<?>>

a java.util.Map object containing zero or more entries, with each entry consisting of 1) a String giving the fully qualified name of a UDT and 2) the Class object for the SQLData implementation that defines how the UDT is to be mapped

Returns:Object

an object instance resolved from the Ref reference and mapped according to the supplied type map

Exceptions
SerialException:
if an error is encountered in the reference resolution
getObjectback to summary
public Object getObject() throws SerialException

Implements java.sql.Ref.getObject.

Returns an Object representing the SQL structured type to which this SerialRef object refers.

Returns:Object

an object instance resolved from the Ref reference

Exceptions
SerialException:
if an error is encountered in the reference resolution
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code for this SerialRef.

Returns:int

a hash code value for this object.

readObjectback to summary
private void readObject(ObjectInputStream s) throws IOException, ClassNotFoundException

readObject is called to restore the state of the SerialRef from a stream.

Parameters
s:ObjectInputStream

the ObjectInputStream to read from.

Exceptions
IOException:
if an I/O error occurs.
ClassNotFoundException:
if the class of a serialized object could not be found.
setObjectback to summary
public void setObject(Object obj) throws SerialException

Implements java.sql.Ref.setObject.

Sets the SQL structured type that this SerialRef object references to the given Object object.

Parameters
obj:Object

an Object representing the SQL structured type to be referenced

Exceptions
SerialException:
if an error is encountered generating the the structured type referenced by this SerialRef object
writeObjectback to summary
private void writeObject(ObjectOutputStream s) throws IOException

writeObject is called to save the state of the SerialRef to a stream.

Parameters
s:ObjectOutputStream

the ObjectOutputStream to write to.

Exceptions
IOException:
if an I/O error occurs.