public class CTField extends CTBase
Constructor and Description |
---|
CTField()
Default constructor for the CTField class.
|
CTField(CTField Field)
Copy constructor for the CTField class.
|
Modifier and Type | Method and Description |
---|---|
void |
ClearFieldDefaultValue()
Clears the current field's default value.
|
void |
CTFieldSetFieldDefaultDateTimeType()
Sets the default field value date and time type to be used
when converting CT_DATE, CT_TIME and CT_TIMES String values.
|
int |
GetCTType()
Retrieves the
FIELD_TYPE . |
int |
GetFieldBinaryFlag()
Retrieves the field binary handling flag.
|
int |
GetFieldDefaultDateType()
Retrieves the default value
DATE_TYPE used
when converting strings to dates. |
int |
GetFieldDefaultTimeType()
Retrieves the default value
TIME_TYPE used
when converting String to time. |
java.lang.String |
GetFieldDefaultValue()
Retrieves the current field default value.
|
java.lang.String |
GetFieldStringEncoding()
Get the field string encoding.
|
int |
GetLength()
Retrieves the field length.
|
java.lang.String |
GetName()
Retrieves the field name.
|
boolean |
GetNullFlag()
Retrieves the field null flag.
|
int |
GetNumber()
Retrieves the field position index in the
CTTable
field list. |
int |
GetPrecision()
Retrieves the field precision.
|
int |
GetScale()
Retrieves the field scale.
|
int |
GetStatus()
Retrieves the status of a field handle.
|
int |
GetType()
Retrieves the
FIELD_TYPE . |
boolean |
IsFieldDefaultValueSet()
Checks if a field default value has been set.
|
boolean |
IsNumeric()
Checks if the field represents a numeric value.
|
void |
SetFieldBinaryFlag(int Flag)
Sets the value of the field binary handling flag.
|
void |
SetFieldDefaultDateTimeType(int DateType,
int TimeType)
Sets the default field value date and time type to be used
when converting CT_DATE, CT_TIME and CT_TIMES String values.
|
void |
SetFieldDefaultValue(java.lang.String Value)
Sets the field default value.
|
void |
SetFieldStringEncoding(java.lang.String encoding)
Set the field string encoding.
|
void |
SetLength(int FieldLength)
Sets the field length.
|
void |
SetName(java.lang.String FieldName)
Sets the field name.
|
void |
SetNullFlag(boolean flag)
Sets Null Flag.
|
void |
SetPrecision(int precision)
Sets the field precision.
|
void |
SetScale(int scale)
Sets the field scale value.
|
void |
SetType(int FieldType,
int FieldLength)
Sets the field
FIELD_TYPE and length. |
Abort, Begin, ClearSavePoint, Commit, GetAutoCommit, GetHandle, GetKeepLock, GetLockMode, GetOperation, GetTransactionMode, IsLockActive, IsTransActive, IsUnicodeLib, Lock, PrepareCommit, RestoreSavePoint, SetAutoCommit, SetHandle, SetKeepLock, SetOperation, SetSavePoint, SetTransactionMode, Unlock
public CTField()
CTField(CTField)
public java.lang.String GetName()
SetName(java.lang.String)
,
GetType()
,
GetLength()
,
IsNumeric()
public int GetType()
FIELD_TYPE
.FIELD_TYPE
value.SetType(int, int)
,
GetName()
,
GetLength()
,
GetCTType()
public int GetCTType()
FIELD_TYPE
.
Maintained for backward compatibility.FIELD_TYPE
value.SetType(int, int)
,
GetName()
,
GetLength()
,
GetType()
public int GetLength()
SetLength(int)
,
GetPrecision()
,
GetScale()
,
GetName()
,
GetType()
public void SetName(java.lang.String FieldName) throws CTException
FieldName
- New field name value.CTException
- in case of errorGetName()
,
SetType(int, int)
,
SetLength(int)
public void SetType(int FieldType, int FieldLength) throws CTException
FIELD_TYPE
and length.FieldType
- New FIELD_TYPE
for the Field.FieldLength
- New length for the Field.CTException
- in case of errorGetType()
,
SetName(java.lang.String)
,
SetLength(int)
public void SetLength(int FieldLength) throws CTException
FieldLength
- New length for the Field.CTException
- in case of errorGetLength()
,
SetPrecision(int)
,
SetScale(int)
,
SetName(java.lang.String)
,
SetType(int, int)
public int GetNumber() throws CTException
CTTable
field list.CTException
- in case of errorGetName()
,
GetLength()
,
GetType()
public boolean GetNullFlag()
SetNullFlag(boolean)
,
GetNumber()
,
GetName()
public int GetPrecision()
SetPrecision(int)
,
GetLength()
,
GetScale()
public int GetScale()
SetScale(int)
,
GetLength()
,
GetPrecision()
public void SetNullFlag(boolean flag) throws CTException
flag
- New field null flag. True if field is null, or false if it is not.CTException
- in case of errorGetNullFlag()
,
SetPrecision(int)
,
SetScale(int)
,
SetName(java.lang.String)
,
SetType(int, int)
public void SetPrecision(int precision) throws CTException
precision
- New field precision value.CTException
- in case of errorGetPrecision()
,
SetNullFlag(boolean)
,
SetScale(int)
,
SetName(java.lang.String)
,
SetType(int, int)
public void SetScale(int scale) throws CTException
scale
- New field scale value.CTException
- in case of errorGetScale()
,
SetNullFlag(boolean)
,
SetPrecision(int)
,
SetName(java.lang.String)
,
SetType(int, int)
public boolean IsNumeric()
GetType()
,
GetLength()
public void SetFieldDefaultValue(java.lang.String Value) throws CTException
The field default value is kept as a String representation of the data. It is recommended that numeric data should be converted to String using one of the rich set of c-treeDB data conversion functions.
Date values should be converted to String using the default date type value.
The default date type value can be retrieved by calling
GetFieldDefaultDateType()
method. By default, the date type is CTDATE_MDCY.
Time values should be converted to String using the default time type value.
The default time type value can be retrieved by calling
GetFieldDefaultTimeType()
function. By default, the time type is CTTIME_HMS.
Time stamp values should be converted to String using the default date type and time type values as described above.
Value
- New field default value.CTException
- in case of errorGetFieldDefaultValue()
,
IsFieldDefaultValueSet()
,
ClearFieldDefaultValue()
,
SetFieldDefaultDateTimeType(int, int)
public java.lang.String GetFieldDefaultValue()
IsFieldDefaultValueSet()
method to check if a field
default value is set or not.SetFieldDefaultValue(java.lang.String)
,
IsFieldDefaultValueSet()
,
ClearFieldDefaultValue()
,
SetFieldDefaultDateTimeType(int, int)
public void ClearFieldDefaultValue() throws CTException
CTException
- in case of errorSetFieldDefaultValue(java.lang.String)
,
GetFieldDefaultValue()
,
IsFieldDefaultValueSet()
,
SetFieldDefaultDateTimeType(int, int)
public void CTFieldSetFieldDefaultDateTimeType() throws CTException
CTException
- in case of errorSetFieldDefaultValue(java.lang.String)
,
ClearFieldDefaultValue()
,
IsFieldDefaultValueSet()
,
SetFieldDefaultDateTimeType(int, int)
public void SetFieldDefaultDateTimeType(int DateType, int TimeType) throws CTException
SetFieldDefaultDateTimeType method modifies both the date and time types. If you wish to change only the default date time, but keep the current time type, use the following example:
hField.SetFieldDefaultDateTimeType(CTDATE_YMD,
hField.GetFieldDefaultTimeType());
You can use the same approach to change only the time type, keeping the current date type:
hField.SetFieldDefaultDateTimeType(
ctdbGetFieldDefaultDateType(), CTIME_HMP);
DateType
- New DATE_TYPE
field value.TimeType
- New TIME_TYPE
field value.CTException
- in case of errorSetFieldDefaultValue(java.lang.String)
,
ClearFieldDefaultValue()
,
IsFieldDefaultValueSet()
,
SetFieldDefaultDateTimeType(int, int)
public boolean IsFieldDefaultValueSet()
GetFieldDefaultValue()
,
ClearFieldDefaultValue()
,
SetFieldDefaultDateTimeType(int, int)
public int GetFieldDefaultDateType()
DATE_TYPE
used
when converting strings to dates.DATE_TYPE
default value.GetFieldDefaultTimeType()
,
GetFieldDefaultValue()
,
ClearFieldDefaultValue()
,
SetFieldDefaultValue(java.lang.String)
public int GetFieldDefaultTimeType()
TIME_TYPE
used
when converting String to time.TIME_TYPE
default valueGetFieldDefaultDateType()
,
GetFieldDefaultValue()
,
ClearFieldDefaultValue()
,
SetFieldDefaultValue(java.lang.String)
public int GetStatus()
FIELD_STATUS
values.FIELD_STATUS
value.GetName()
,
GetType()
,
GetLength()
,
GetNumber()
public int GetFieldBinaryFlag()
BINARY_FLAG
indicates how c-treeDB will handle
CT_ARRAY, CT_F2STRING, and CT_2STRING fields.BINARY_FLAG
value.SetFieldBinaryFlag(int)
public void SetFieldBinaryFlag(int Flag) throws CTException
BINARY_FLAG
indicates how c-treeDB will handle
CT_ARRAY, CT_F2STRING and CT_2STRING fields.Flag
- New field BINARY_FLAG
value.CTException
- in case of errorGetFieldBinaryFlag()
public void SetFieldStringEncoding(java.lang.String encoding) throws CTException
encoding
- a string describing the encoding used in the field content.
CTDB does not enfore any check on the value passed in, yet
JTDB, JDBC, Ado .Net provider and SQL server expect to be able
to identify the encoding therefore use values as defined by IANA
https://www.iana.org/assignments/character-sets/character-sets.xhtmlCTException
- in case of errorGetFieldStringEncoding()
public java.lang.String GetFieldStringEncoding() throws CTException
CTException
- in case of error