java.io.Externalizable, java.io.Serializable, java.lang.Comparable, Formatable, Storable, TypedFormat, DataValueDescriptor, Orderable, UserDataValueUTFpublic class UserType extends DataType implements UserDataValue
| Modifier and Type | Field | Description |
|---|---|---|
private static int |
BASE_MEMORY_USAGE |
|
private java.lang.Object |
value |
UNKNOWN_LOGICAL_LENGTHORDER_OP_EQUALS, ORDER_OP_GREATEROREQUALS, ORDER_OP_GREATERTHAN, ORDER_OP_LESSOREQUALS, ORDER_OP_LESSTHAN| Constructor | Description |
|---|---|
UserType() |
no-arg constructor required by Formattable
|
UserType(java.lang.Object value) |
| Modifier and Type | Method | Description |
|---|---|---|
DataValueDescriptor |
cloneValue(boolean forceMaterialization) |
Clone this DataValueDescriptor.
|
boolean |
compare(int op,
DataValueDescriptor other,
boolean orderedNulls,
boolean unknownRV) |
Compare this Orderable with a given Orderable for the purpose of
qualification and sorting.
|
int |
compare(DataValueDescriptor other) |
Orderable interface
|
BooleanDataValue |
equals(DataValueDescriptor left,
DataValueDescriptor right) |
The = operator as called from the language module, as opposed to
the storage module.
|
int |
estimateMemoryUsage() |
Estimate the memory usage in bytes of the data value and the overhead of the class.
|
boolean |
getBoolean() |
Gets the value in the data value descriptor as a boolean.
|
byte |
getByte() |
Gets the value in the data value descriptor as a byte.
|
byte[] |
getBytes() |
Gets the value in the data value descriptor as a byte[].
|
java.sql.Date |
getDate(java.util.Calendar cal) |
Gets the value in the data value descriptor as a java.sql.Date.
|
double |
getDouble() |
Gets the value in the data value descriptor as a double.
|
float |
getFloat() |
Gets the value in the data value descriptor as a float.
|
int |
getInt() |
Gets the value in the data value descriptor as a int.
|
int |
getLength() |
Gets the length of the data value.
|
long |
getLong() |
Gets the value in the data value descriptor as a long.
|
DataValueDescriptor |
getNewNull() |
Get a new null value of the same type as this data value.
|
java.lang.Object |
getObject() |
Gets the value in the data value descriptor as a int.
|
short |
getShort() |
Gets the value in the data value descriptor as a short.
|
java.lang.String |
getString() |
Gets the value in the data value descriptor as a String.
|
java.sql.Time |
getTime(java.util.Calendar cal) |
Gets the value in the data value descriptor as a java.sql.Time.
|
java.sql.Timestamp |
getTimestamp(java.util.Calendar cal) |
Gets the value in the data value descriptor as a java.sql.Timestamp.
|
int |
getTypeFormatId() |
Return my format identifier.
|
java.lang.String |
getTypeName() |
Get the SQL name of the datatype
|
(package private) java.lang.String |
getTypeName(java.lang.String className) |
Get the type name of this value, overriding
with the passed in class name (for user/java types).
|
int |
hashCode() |
|
boolean |
isNull() |
Check if the value is null.
|
BooleanDataValue |
notEquals(DataValueDescriptor left,
DataValueDescriptor right) |
The <> operator as called from the language module, as opposed to
the storage module.
|
void |
readExternal(java.io.ObjectInput in) |
|
void |
restoreToNull() |
Restore this object to its (SQL)null value.
|
void |
setBigDecimal(java.math.BigDecimal theValue) |
Only to be called when the application sets a value using BigDecimal
|
protected void |
setFrom(DataValueDescriptor theValue) |
Set the value of this DataValueDescriptor based on the value
of the specified DataValueDescriptor.
|
(package private) void |
setObject(java.lang.Object theValue) |
Set the value from an non-null object.
|
void |
setValue(java.lang.Object value) |
Set the value of this DataValueDescriptor.
|
void |
setValue(java.lang.String theValue) |
Set the value of this DataValueDescriptor.
|
void |
setValueFromResultSet(java.sql.ResultSet resultSet,
int colNumber,
boolean isNullable) |
Set the value based on the value for the specified DataValueDescriptor
from the specified ResultSet.
|
java.lang.String |
toString() |
|
int |
typePrecedence() |
Each built-in type in JSQL has a precedence.
|
void |
writeExternal(java.io.ObjectOutput out) |
checkHostVariable, cloneHolder, coalesce, compare, compare, compareTo, dataTypeConversion, equals, flip, genericSetObject, getStream, getTraceString, greaterOrEquals, greaterThan, hasStream, in, invalidFormat, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, outOfRange, readExternalFromArray, recycle, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, throwLangSetMismatch, throwLangSetMismatch, typeToBigDecimalcheckHostVariable, cloneHolder, coalesce, compare, compare, getStream, getTraceString, greaterOrEquals, greaterThan, hasStream, in, isNotNull, isNullOp, lessOrEquals, lessThan, normalize, readExternalFromArray, recycle, setInto, setInto, setObjectForCast, setToNull, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, typeToBigDecimalprivate java.lang.Object value
private static final int BASE_MEMORY_USAGE
public UserType()
public UserType(java.lang.Object value)
public int estimateMemoryUsage()
DataValueDescriptorestimateMemoryUsage in interface DataValueDescriptorpublic java.lang.String getString()
DataValueDescriptorgetString in interface DataValueDescriptorpublic boolean getBoolean()
throws StandardException
DataTypegetBoolean in interface DataValueDescriptorgetBoolean in class DataTypeStandardException - thrown on failure to convertpublic byte getByte()
throws StandardException
DataTypegetByte in interface DataValueDescriptorgetByte in class DataTypeStandardException - thrown on failure to convertpublic short getShort()
throws StandardException
DataTypegetShort in interface DataValueDescriptorgetShort in class DataTypeStandardException - thrown on failure to convertpublic int getInt()
throws StandardException
DataTypegetInt in interface DataValueDescriptorgetInt in class DataTypeStandardException - thrown on failure to convertpublic long getLong()
throws StandardException
DataTypegetLong in interface DataValueDescriptorgetLong in class DataTypeStandardException - thrown on failure to convertpublic float getFloat()
throws StandardException
DataTypegetFloat in interface DataValueDescriptorgetFloat in class DataTypeStandardException - thrown on failure to convertpublic double getDouble()
throws StandardException
DataTypegetDouble in interface DataValueDescriptorgetDouble in class DataTypeStandardException - thrown on failure to convertpublic byte[] getBytes()
throws StandardException
DataTypegetBytes in interface DataValueDescriptorgetBytes in class DataTypeStandardException - thrown on failure to convertpublic java.sql.Date getDate(java.util.Calendar cal)
throws StandardException
DataTypegetDate in interface DataValueDescriptorgetDate in class DataTypecal - calendar for object creationStandardException - thrown on failurepublic java.sql.Time getTime(java.util.Calendar cal)
throws StandardException
DataTypegetTime in interface DataValueDescriptorgetTime in class DataTypecal - calendar for object creationStandardException - thrown on failurepublic java.sql.Timestamp getTimestamp(java.util.Calendar cal)
throws StandardException
DataTypegetTimestamp in interface DataValueDescriptorgetTimestamp in class DataTypecal - calendar for object creationStandardException - thrown on failurevoid setObject(java.lang.Object theValue)
DataTypepublic java.lang.Object getObject()
DataTypegetObject in interface DataValueDescriptorgetObject in class DataTypepublic int getLength()
DataValueDescriptorgetLength in interface DataValueDescriptorpublic java.lang.String getTypeName()
DataValueDescriptorgetTypeName in interface DataValueDescriptorjava.lang.String getTypeName(java.lang.String className)
getTypeName in class DataTypepublic int getTypeFormatId()
getTypeFormatId in interface TypedFormatTypedFormat.getTypeFormatId()public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal in interface java.io.Externalizablejava.io.IOException - error writing datapublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal in interface java.io.Externalizablejava.io.IOException - Thrown on error reading the objectjava.lang.ClassNotFoundException - Thrown if the class of the object
is not foundExternalizable.readExternal(java.io.ObjectInput)public DataValueDescriptor cloneValue(boolean forceMaterialization)
DataValueDescriptor
Even though the objects can be modified independently regardless of the
value of forceMaterialization, both the clone and the
original may be dependent on the store state if
forceMaterialization is set to false. An example is if
you need to access the value you just read using cloneValue
after the current transaction has ended, or after the source result set
has been closed.
cloneValue in interface DataValueDescriptorforceMaterialization - any streams representing the data value will
be materialized if true, the data value will be kept as a
stream if possible if falseDataValueDescriptor with the same initial
value as this.DataValueDescriptor.cloneValue(boolean)public DataValueDescriptor getNewNull()
DataValueDescriptorgetNewNull in interface DataValueDescriptorDataValueDescriptor.getNewNull()public void restoreToNull()
StorablerestoreToNull in interface StorableStorable.restoreToNull()public void setValueFromResultSet(java.sql.ResultSet resultSet,
int colNumber,
boolean isNullable)
throws java.sql.SQLException
DataValueDescriptorsetValueFromResultSet in interface DataValueDescriptorresultSet - The specified ResultSet.colNumber - The 1-based column # into the resultSet.isNullable - Whether or not the column is nullable
(No need to call wasNull() if not)java.sql.SQLException - Thrown on errorDataValueDescriptor.setValueFromResultSet(java.sql.ResultSet, int, boolean)public int compare(DataValueDescriptor other) throws StandardException
compare in interface DataValueDescriptorother - The Orderable to compare this one to.StandardException - thrown on failureOrderablepublic boolean compare(int op,
DataValueDescriptor other,
boolean orderedNulls,
boolean unknownRV)
throws StandardException
DataValueDescriptorcompare in interface DataValueDescriptorcompare in class DataTypeop - Orderable.ORDER_OP_EQUALS means do an = comparison.
Orderable.ORDER_OP_LESSTHAN means compare this < other.
Orderable.ORDER_OP_LESSOREQUALS means compare this <= other.other - The DataValueDescriptor to compare this one to.orderedNulls - True means to treat nulls as ordered values,
that is, treat SQL null as equal to null, and less
than all other values.
False means to treat nulls as unknown values,
that is, the result of any comparison with a null
is the UNKNOWN truth value.unknownRV - The return value to use if the result of the
comparison is the UNKNOWN truth value. In other
words, if orderedNulls is false, and a null is
involved in the comparison, return unknownRV.
This parameter is not used orderedNulls is true.StandardException - thrown on errorpublic void setValue(java.lang.Object value)
DataTypesetValue in interface DataValueDescriptorsetValue in interface UserDataValuesetValue in class DataTypevalue - The Object value to set this DataValueDescriptor toUserDataValue.setValue(java.lang.Object)protected void setFrom(DataValueDescriptor theValue) throws StandardException
DataTypesetFrom in class DataTypetheValue - The DataValueDescriptor that holds the value to
which we want to set this DataValueDescriptor's value.StandardExceptionpublic void setBigDecimal(java.math.BigDecimal theValue)
DataTypesetBigDecimal in interface DataValueDescriptorsetBigDecimal in class DataTypetheValue - required to be a BigDecimal or null.UserDataValue.setValue(java.lang.Object)public void setValue(java.lang.String theValue)
DataTypesetValue in interface DataValueDescriptorsetValue in class DataTypetheValue - The BigDecimal value to set this DataValueDescriptor topublic BooleanDataValue equals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException
equals in interface DataValueDescriptorequals in class DataTypeleft - The value on the left side of the =right - The value on the right side of the =StandardException - Thrown on errorpublic BooleanDataValue notEquals(DataValueDescriptor left, DataValueDescriptor right) throws StandardException
notEquals in interface DataValueDescriptornotEquals in class DataTypeleft - The value on the left side of the operatorright - The value on the right side of the operatorStandardException - Thrown on errorpublic java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic int typePrecedence()
DataTypetypePrecedence in interface DataValueDescriptortypePrecedence in class DataTypeDataValueDescriptor.typePrecedence()Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.