public class HandleUserType extends AbstractWrapperUserType
P2J handle
. This permits Hibernate to
convert this data type to and from the SQL VARCHAR data type. The unknown
value is mapped to SQL NULL.Modifier and Type | Field and Description |
---|---|
private static int[] |
SQL_TYPES
Single element array containing the SQL type constant being mapped
|
LOG, LOG_TRACE
Constructor and Description |
---|
HandleUserType() |
Modifier and Type | Method and Description |
---|---|
protected void |
bindNonNull(java.sql.PreparedStatement ps,
BaseDataType value,
int index)
Set a
String value into the given prepared statement,
based upon the handle instance value . |
java.lang.Object |
deepCopy(java.lang.Object value)
Create and return a deep copy of the given
handle instance. |
protected java.lang.Object |
getBaseValue(java.sql.ResultSet rs,
java.lang.String column)
Extract a
String value from a result set at a particular
column. |
protected BaseDataType |
instantiateRegular(java.lang.Object value)
Construct and return an instance of
handle which wraps
value . |
protected BaseDataType |
instantiateUnknown()
Construct and return an instance of
handle which is
initialized to the unknown value. |
java.lang.Class |
returnedClass()
Gets the Java data type class mapped by this custom type.
|
int[] |
sqlTypes()
Get the array of SQL data type constants (in this case only a single
constant), which this classes uses to map a handle to/from a
database record.
|
assemble, disassemble, equals, hashCode, isMutable, nullSafeGet, nullSafeSet, replace, toString
private static final int[] SQL_TYPES
public int[] sqlTypes()
public final java.lang.Class returnedClass()
P2J handle
class.public final java.lang.Object deepCopy(java.lang.Object value)
handle
instance.value
- The handle
instance to be copied.handle
which contains the
same internal value as value
.protected final java.lang.Object getBaseValue(java.sql.ResultSet rs, java.lang.String column) throws java.sql.SQLException
String
value from a result set at a particular
column.getBaseValue
in class AbstractWrapperUserType
rs
- Result set containing data to be extracted.column
- Name of the column at which data will be extracted.null
.java.sql.SQLException
- if a database access error occurs.protected final BaseDataType instantiateUnknown()
handle
which is
initialized to the unknown value.instantiateUnknown
in class AbstractWrapperUserType
handle
instance which represents the unknown
value.protected final BaseDataType instantiateRegular(java.lang.Object value)
handle
which wraps
value
.instantiateRegular
in class AbstractWrapperUserType
value
- String value to be wrapped by a handle
; will not
be null
.value
wrapped in a handle
.protected final void bindNonNull(java.sql.PreparedStatement ps, BaseDataType value, int index) throws java.sql.SQLException
String
value into the given prepared statement,
based upon the handle
instance value
.bindNonNull
in class AbstractWrapperUserType
ps
- Prepared statement into which we will set our data.value
- A handle
instance.index
- Index in the statement at which to write the data.java.sql.SQLException
- if an error occurs setting data into the statement.