@Module public abstract class Column extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
Column.ColumnType |
Modifier and Type | Field and Description |
---|---|
protected int |
_columnOffset |
protected byte |
_nullMask |
Modifier and Type | Method and Description |
---|---|
void |
close()
Cleanup of the column on table shutdown.
|
void |
evalToResult(long blockId,
byte[] block,
int rowOffset,
SelectResult result)
Evaluates the column to the result.
|
int |
getAutoIncrement()
Set if the column is unique.
|
byte[] |
getBytes(long blockId,
byte[] block,
int rowOffset)
Gets a string value from the column.
|
long |
getDate(byte[] block,
int rowOffset)
Gets a double value in the column.
|
abstract int |
getDeclarationSize()
Returns the column's size (from the decl).
|
Expr |
getDefault()
Gets the default expression
|
double |
getDouble(long blockId,
byte[] block,
int rowOffset)
Sets a double value in the column.
|
BTree |
getIndex()
Returns the index.
|
KeyCompare |
getIndexKeyCompare()
Returns the key compare for the column.
|
int |
getInteger(long blockId,
byte[] block,
int rowOffset)
Sets an integer value in the column.
|
java.lang.Class<?> |
getJavaType()
Returns the java type.
|
long |
getLong(long blockId,
byte[] block,
int rowOffset)
Sets a long value in the column.
|
java.lang.String |
getName()
Returns the column's name.
|
int |
getSQLType() |
abstract java.lang.String |
getString(long blockId,
byte[] block,
int rowOffset)
Gets a string value from the column.
|
Table |
getTable()
Gets the table.
|
abstract Column.ColumnType |
getTypeCode()
Returns the column's code.
|
boolean |
isEqual(byte[] buffer1,
int rowOffset1,
byte[] buffer2,
int rowOffset2)
Returns true if the bytes are equal.
|
boolean |
isEqual(byte[] block,
int rowOffset,
byte[] buffer,
int offset,
int length)
Returns true if the bytes are equal.
|
boolean |
isEqual(long blockId,
byte[] block,
int rowOffset,
java.lang.String string)
Returns true if the string is equal.
|
boolean |
isNotNull()
Returns true if the column is NOT NULL.
|
boolean |
isNull(byte[] block,
int rowOffset)
Returns true if the column is null.
|
boolean |
isPrimaryKey()
Returns true if the column is a primary key
|
boolean |
isUnique()
Returns true if the column is unique.
|
boolean |
isValid(byte[] block,
int rowOffset)
Returns true if the column is valid (i.e.
|
void |
set(DbTransaction xa,
TableIterator iter,
Expr expr,
QueryContext context)
Sets based on an iterator.
|
void |
setAutoIncrement(int min)
Returns true if the column is auto increment
|
void |
setDefault(Expr expr)
Sets the default expression
|
void |
setIndex(BTree index)
Sets the index.
|
protected void |
setNonNull(byte[] block,
int rowOffset)
Sets the column non-null.
|
void |
setNotNull()
Set true if the column is NOT NULL.
|
void |
setNull(byte[] block,
int rowOffset)
Sets the column null.
|
void |
setPrimaryKey(boolean primaryKey)
Returns true if the column is a primary key
|
void |
setUnique()
Set if the column is unique.
|
java.lang.String |
toString() |
protected final int _columnOffset
protected final byte _nullMask
public java.lang.String getName()
public Table getTable()
public abstract Column.ColumnType getTypeCode()
public java.lang.Class<?> getJavaType()
public int getSQLType()
public boolean isPrimaryKey()
public void setPrimaryKey(boolean primaryKey)
public boolean isUnique()
public void setUnique()
public BTree getIndex()
public void setIndex(BTree index)
public KeyCompare getIndexKeyCompare()
public void setNotNull()
public boolean isNotNull()
public void setDefault(Expr expr)
public Expr getDefault()
public void setAutoIncrement(int min)
public int getAutoIncrement()
public abstract int getDeclarationSize()
public boolean isNull(byte[] block, int rowOffset)
block
- the block's bufferrowOffset
- the offset of the row in the blockpublic final void setNull(byte[] block, int rowOffset)
block
- the block's bufferrowOffset
- the offset of the row in the blockprotected final void setNonNull(byte[] block, int rowOffset)
block
- the block's bufferrowOffset
- the offset of the row in the blockpublic abstract java.lang.String getString(long blockId, byte[] block, int rowOffset) throws java.sql.SQLException
block
- the block's bufferrowOffset
- the offset of the row in the blockjava.sql.SQLException
public int getInteger(long blockId, byte[] block, int rowOffset) throws java.sql.SQLException
block
- the block's bufferrowOffset
- the offset of the row in the blockvalue
- the value to storejava.sql.SQLException
public long getLong(long blockId, byte[] block, int rowOffset) throws java.sql.SQLException
block
- the block's bufferrowOffset
- the offset of the row in the blockvalue
- the value to storejava.sql.SQLException
public double getDouble(long blockId, byte[] block, int rowOffset) throws java.sql.SQLException
block
- the block's bufferrowOffset
- the offset of the row in the blockvalue
- the value to storejava.sql.SQLException
public byte[] getBytes(long blockId, byte[] block, int rowOffset) throws java.sql.SQLException
block
- the block's bufferrowOffset
- the offset of the row in the blockjava.sql.SQLException
public long getDate(byte[] block, int rowOffset) throws java.sql.SQLException
block
- the block's bufferrowOffset
- the offset of the row in the blockjava.sql.SQLException
public boolean isValid(byte[] block, int rowOffset)
block
- the block's bufferrowOffset
- the offset of the row in the blockpublic boolean isEqual(byte[] block, int rowOffset, byte[] buffer, int offset, int length)
public boolean isEqual(byte[] buffer1, int rowOffset1, byte[] buffer2, int rowOffset2)
public boolean isEqual(long blockId, byte[] block, int rowOffset, java.lang.String string) throws java.sql.SQLException
java.sql.SQLException
public void evalToResult(long blockId, byte[] block, int rowOffset, SelectResult result) throws java.sql.SQLException
java.sql.SQLException
public void set(DbTransaction xa, TableIterator iter, Expr expr, QueryContext context) throws java.sql.SQLException
java.sql.SQLException
public void close()
public java.lang.String toString()
toString
in class java.lang.Object