public final class FieldDescriptor
extends java.lang.Object
FieldDescriptor
contains the column metadata of the XSQLVAR server
data structure used to describe one column for input or output.
FieldDescriptor is an immutable type, the value of a field is maintained separately in an instance of FieldValue
.
Constructor and Description |
---|
FieldDescriptor(int position,
DatatypeCoder datatypeCoder,
int type,
int subType,
int scale,
int length,
java.lang.String fieldName,
java.lang.String tableAlias,
java.lang.String originalName,
java.lang.String originalTableName,
java.lang.String ownerName)
Constructor for metadata FieldDescriptor.
|
Modifier and Type | Method and Description |
---|---|
FieldValue |
createDefaultFieldValue()
Creates a default, uninitialized
FieldValue |
boolean |
equals(java.lang.Object obj) |
DatatypeCoder |
getDatatypeCoder() |
IEncodingFactory |
getEncodingFactory() |
java.lang.String |
getFieldName() |
int |
getLength() |
java.lang.String |
getOriginalName() |
java.lang.String |
getOriginalTableName() |
java.lang.String |
getOwnerName() |
int |
getPosition() |
int |
getScale() |
int |
getSubType() |
java.lang.String |
getTableAlias() |
int |
getType() |
int |
hashCode() |
boolean |
isFbType(int fbType)
Check if the type of this field is the specified Firebird data type.
|
boolean |
isNullable() |
boolean |
isVarying() |
java.lang.String |
toString() |
boolean |
typeEquals(FieldDescriptor other)
Limited equals that only checks if the data type in the provided field descriptor is the same as this descriptor.
|
public FieldDescriptor(int position, DatatypeCoder datatypeCoder, int type, int subType, int scale, int length, java.lang.String fieldName, java.lang.String tableAlias, java.lang.String originalName, java.lang.String originalTableName, java.lang.String ownerName)
position
- Position of this field (0-based), or -1
if position is not known (eg for test code)datatypeCoder
- Instance of DatatypeCoder to use when decoding column datatype
- Column SQL typesubType
- Column subtypescale
- Column scalelength
- Column defined lengthfieldName
- Column alias nametableAlias
- Column table aliasoriginalName
- Column original nameoriginalTableName
- Column original tableownerName
- Owner of the column/tablepublic int getPosition()
-1
)public DatatypeCoder getDatatypeCoder()
DatatypeCoder
to use when decoding field data.public IEncodingFactory getEncodingFactory()
IEncodingFactory
for the associated connection.public int getType()
public int getSubType()
public int getScale()
public int getLength()
public java.lang.String getFieldName()
public java.lang.String getTableAlias()
public java.lang.String getOriginalName()
public java.lang.String getOriginalTableName()
public java.lang.String getOwnerName()
public boolean isVarying()
true
if the type is variable length (ie ISCConstants.SQL_VARYING
).public boolean isFbType(int fbType)
This method assumes the not-nullable data type is passed, on checking the nullable bit of getType()
is
set to 0
.
fbType
- One of the SQL_
data type identifier valuestrue
if the type is the same as the type of this fieldpublic boolean isNullable()
true
if this field is nullable.public FieldValue createDefaultFieldValue()
FieldValue
FieldValue
public boolean typeEquals(FieldDescriptor other)
The fields checked are:
other
- Field descriptor to checktrue
when other
is not null and has the same type definition as this instance,
false
otherwise.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
Copyright © 2001-2021 Jaybird (Firebird JDBC/JCA) team. All rights reserved.