Top Description Constructors Methods
org.apache.derby.impl.store.access.conglomerate

public abstract Class GenericConglomerate

extends DataType
implements Conglomerate
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.store.access.conglomerate.Conglomerate, org.apache.derby.iapi.types.DataValueDescriptor, org.apache.derby.iapi.types.Orderable, org.apache.derby.iapi.services.io.Storable, org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable
Known Direct Subclasses
org.apache.derby.impl.store.access.heap.Heap, org.apache.derby.impl.store.access.btree.BTree
Imports
org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.store.access.conglomerate.Conglomerate, org.apache.derby.iapi.types.DataValueDescriptor, .DataType, .StringDataValue, java.sql.ResultSet, .SQLException

A class that implements the methods shared across all implementations of the Conglomerate interface.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public DataValueDescriptor
cloneValue(boolean
any streams representing the data value will be materialized if true, the data value will be kept as a stream if possible if false
forceMaterialization
)

Implements org.apache.derby.iapi.types.DataValueDescriptor.cloneValue.

Clone this DataValueDescriptor.

public int

Returns:

<0 - this Orderable is less than other. 0 - this Orderable equals other. >0 - this Orderable is greater than other. The code should not explicitly look for -1, or 1.
compare
(DataValueDescriptor
The Orderable to compare this one to.
other
)

Implements org.apache.derby.iapi.types.DataValueDescriptor.compare.

Compare this Orderable with a given Orderable for the purpose of index positioning.

public int

Returns:

The length of the data value
getLength
()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getLength.

Gets the length of the data value.

public DataValueDescriptor
getNewNull()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getNewNull.

Get a new null value of the same type as this data value.

public Object

Returns:

The data value as an Object.
getObject
()

Overrides org.apache.derby.iapi.types.DataType.getObject.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getObject.

Gets the value in the data value descriptor as a Java Object.

public String

Returns:

The data value as a String.
getString
()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getString.

Gets the value in the data value descriptor as a String.

public String

Returns:

The SQL name of the datatype
getTypeName
()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTypeName.

Get the SQL name of the datatype

public static boolean

Returns:

true if a collation other than UCS BASIC was found.
hasCollatedColumns
(int[]
collation ids for the conglomerate columns
collationIds
)

Tells if there are columns with collations (other than UCS BASIC) in the given list of collation ids.

protected void
setFrom(DataValueDescriptor
The Date value to set this DataValueDescriptor to
theValue
)

Overrides org.apache.derby.iapi.types.DataType.setFrom.

Set the value of this DataValueDescriptor from another.

public void
setValueFromResultSet(ResultSet
The specified ResultSet.
resultSet
,
int
The 1-based column # into the resultSet.
colNumber
,
boolean
Whether or not the column is nullable (No need to call wasNull() if not)
isNullable
)

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValueFromResultSet.

Set the value based on the value for the specified DataValueDescriptor from the specified ResultSet.

Inherited from org.apache.derby.iapi.types.DataType:
checkHostVariablecloneHoldercoalescecomparecomparecomparecompareTodataTypeConversionequalsequalsflipgetBooleangetBytegetBytesgetDategetDoublegetFloatgetIntgetLonggetShortgetStreamgetTimegetTimestampgetTraceStringgreaterOrEqualsgreaterThanhasStreamininvalidFormatisNotNullisNullOplessOrEqualslessThannormalizenotEqualsoutOfRangereadExternalFromArrayrecyclesetBigDecimalsetIntosetIntosetObjectForCastsetToNullsetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuesetValuethrowLangSetMismatchtypePrecedencetypeToBigDecimal

Constructor Detail

GenericConglomerateback to summary
public GenericConglomerate()

Method Detail

cloneValueback to summary
public DataValueDescriptor cloneValue(boolean forceMaterialization)

Implements org.apache.derby.iapi.types.DataValueDescriptor.cloneValue.

Doc from org.apache.derby.iapi.types.DataValueDescriptor.cloneValue.

Clone this DataValueDescriptor. Results in a new object that has the same value as this but can be modified independently.

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.

Parameters
forceMaterialization:boolean

any streams representing the data value will be materialized if true, the data value will be kept as a stream if possible if false

Returns:DataValueDescriptor

A clone of the DataValueDescriptor with the same initial value as this.

See Also
org.apache.derby.iapi.types.DataValueDescriptor#cloneValue
compareback to summary
public int compare(DataValueDescriptor other) throws StandardException

Implements org.apache.derby.iapi.types.DataValueDescriptor.compare.

Compare this Orderable with a given Orderable for the purpose of index positioning. This method treats nulls as ordered values - that is, it treats SQL null as equal to null and less than all other values.

Parameters
other:DataValueDescriptor

The Orderable to compare this one to.

Returns:int

<0 - this Orderable is less than other. 0 - this Orderable equals other. >0 - this Orderable is greater than other. The code should not explicitly look for -1, or 1.

Exceptions
StandardException:
Thrown on error
See Also
DataValueDescriptor#compare
getLengthback to summary
public int getLength() throws StandardException

Implements org.apache.derby.iapi.types.DataValueDescriptor.getLength.

Gets the length of the data value. The meaning of this is implementation-dependent. For string types, it is the number of characters in the string. For numeric types, it is the number of bytes used to store the number. This is the actual length of this value, not the length of the type it was defined as. For example, a VARCHAR value may be shorter than the declared VARCHAR (maximum) length.

Returns:int

The length of the data value

Exceptions
StandardException:
On error
See Also
org.apache.derby.iapi.types.DataValueDescriptor#getLength
getNewNullback to summary
public DataValueDescriptor getNewNull()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getNewNull.

Get a new null value of the same type as this data value.

See Also
org.apache.derby.iapi.types.DataValueDescriptor#getNewNull
getObjectback to summary
public Object getObject() throws StandardException

Overrides org.apache.derby.iapi.types.DataType.getObject.

Implements org.apache.derby.iapi.types.DataValueDescriptor.getObject.

Gets the value in the data value descriptor as a Java Object. The type of the Object will be the Java object type corresponding to the data value's SQL type. JDBC defines a mapping between Java object types and SQL types - we will allow that to be extended through user type definitions. Throws an exception if the data value is not an object (yeah, right).

Returns:Object

The data value as an Object.

Exceptions
StandardException:
Thrown on error
See Also
org.apache.derby.iapi.types.DataValueDescriptor#getObject
getStringback to summary
public String getString() throws StandardException

Implements org.apache.derby.iapi.types.DataValueDescriptor.getString.

Gets the value in the data value descriptor as a String. Throws an exception if the data value is not a string.

Returns:String

The data value as a String.

Exceptions
StandardException:
Thrown on error
See Also
org.apache.derby.iapi.types.DataValueDescriptor#getString
getTypeNameback to summary
public String getTypeName()

Implements org.apache.derby.iapi.types.DataValueDescriptor.getTypeName.

Get the SQL name of the datatype

Returns:String

The SQL name of the datatype

See Also
org.apache.derby.iapi.types.DataValueDescriptor#getTypeName
hasCollatedColumnsback to summary
public static boolean hasCollatedColumns(int[] collationIds)

Tells if there are columns with collations (other than UCS BASIC) in the given list of collation ids.

Parameters
collationIds:int[]

collation ids for the conglomerate columns

Returns:boolean

true if a collation other than UCS BASIC was found.

setFromback to summary
protected void setFrom(DataValueDescriptor theValue) throws StandardException

Overrides org.apache.derby.iapi.types.DataType.setFrom.

Set the value of this DataValueDescriptor from another.

Parameters
theValue:DataValueDescriptor

The Date value to set this DataValueDescriptor to

See Also
org.apache.derby.iapi.types.DataValueDescriptor#setValue
setValueFromResultSetback to summary
public void setValueFromResultSet(ResultSet resultSet, int colNumber, boolean isNullable) throws StandardException, SQLException

Implements org.apache.derby.iapi.types.DataValueDescriptor.setValueFromResultSet.

Set the value based on the value for the specified DataValueDescriptor from the specified ResultSet.

Parameters
resultSet:ResultSet

The specified ResultSet.

colNumber:int

The 1-based column # into the resultSet.

isNullable:boolean

Whether or not the column is nullable (No need to call wasNull() if not)

Exceptions
StandardException:
Thrown on error
SQLException:
Error accessing the result set
See Also
org.apache.derby.iapi.types.DataValueDescriptor#setValueFromResultSet