Class FieldDescription
java.lang.Object
com.apple.foundationdb.relational.api.FieldDescription
A description of an individual field.
Note that this representation is indicative of JDBC-API level information. That is, it is used to hold
information that is necessary to represent a given column field in a JDBC MetaData API.
-
Method Summary
Modifier and TypeMethodDescriptionstatic FieldDescription
array
(String fieldName, int nullable, ArrayMetaData definition) Create an array field.boolean
getName()
int
int
hashCode()
boolean
isArray()
int
boolean
boolean
isStruct()
static FieldDescription
Create a primitive field.static FieldDescription
Create a primitive field.static FieldDescription
struct
(String fieldName, int nullable, StructMetaData definition) Create a struct field.
-
Method Details
-
primitive
Create a primitive field. This is a convenience factory method for a more complicated constructor. Equivalent toprimitive(String, int, int, boolean)
, wherephantom == false
.- Parameters:
fieldName
- the name of the field.sqlTypeCode
- the SQL type code for this field. Should match values found inTypes
nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.- Returns:
- a FieldDescription for the field.
-
primitive
public static FieldDescription primitive(@Nonnull String fieldName, int sqlTypeCode, int nullable, boolean phantom) Create a primitive field. This is a convenience factory method for a more complicated constructor.- Parameters:
fieldName
- the name of the field.sqlTypeCode
- the SQL type code for this field. Should match values found inTypes
nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.phantom
- if true, this column should be treated as "phantom" in the API. That is, its entries are present in the returned row, but are not represented as part of the "return value". In other words, the values take up space in the physical arrays, but are not considered part of the actual return of the query, requiring the implementation to adjust for the field's position.- Returns:
- a FieldDescription for the field.
-
struct
public static FieldDescription struct(@Nonnull String fieldName, int nullable, StructMetaData definition) Create a struct field. This is a convenience factory method for a more complicated constructor.- Parameters:
fieldName
- the name of the field.nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.definition
- the definition of the struct value itself.- Returns:
- a FieldDescription for the field.
-
array
public static FieldDescription array(@Nonnull String fieldName, int nullable, ArrayMetaData definition) Create an array field. This is a convenience factory method for a more complicated constructor.- Parameters:
fieldName
- the name of the field.nullable
- one ofDatabaseMetaData.columnNoNulls
,DatabaseMetaData.columnNullable
, orDatabaseMetaData.columnNullableUnknown
.definition
- the metadata description of the contents of the array.- Returns:
- a FieldDescription for the field.
-
getName
-
getSqlTypeCode
public int getSqlTypeCode() -
isStruct
public boolean isStruct() -
isArray
public boolean isArray() -
getFieldMetaData
-
getArrayMetaData
-
isNullable
public int isNullable() -
isPhantom
public boolean isPhantom() -
equals
-
hashCode
public int hashCode()
-