Package org.postgresql.core
Class Field
- java.lang.Object
-
- org.postgresql.core.Field
-
public class Field extends java.lang.Object
-
-
Field Summary
Fields Modifier and Type Field Description static intBINARY_FORMATprivate java.lang.StringcolumnLabelprivate intformatprivate intlengthprivate FieldMetadatametadataprivate intmodprivate static java.lang.StringNOT_YET_LOADEDprivate intoidprivate java.lang.StringpgTypeprivate intpositionInTableprivate intsqlTypeprivate inttableOidstatic intTEXT_FORMAT
-
Constructor Summary
Constructors Constructor Description Field(java.lang.String name, int oid)Constructor without mod parameter.Field(java.lang.String name, int oid, int length, int mod)Construct a field based on the information fed to it.Field(java.lang.String columnLabel, int oid, int length, int mod, int tableOid, int positionInTable)Construct a field based on the information fed to it.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetColumnLabel()Returns the column label of this Field's data type.intgetFormat()Returns the format of this Field's data (text=0, binary=1).intgetLength()Returns the length of this Field's data type.FieldMetadatagetMetadata()intgetMod()Returns the mod of this Field's data typeintgetOID()Returns the oid of this Field's data type.java.lang.StringgetPGType()intgetPositionInTable()intgetSQLType()intgetTableOid()Returns the columns' table oid, zero if no oid available.booleanisTypeInitialized()voidsetFormat(int format)Sets the format of this Field's data (text=0, binary=1).voidsetMetadata(FieldMetadata metadata)voidsetPGType(java.lang.String pgType)voidsetSQLType(int sqlType)java.lang.StringtoString()voidupperCaseLabel()
-
-
-
Field Detail
-
TEXT_FORMAT
public static final int TEXT_FORMAT
- See Also:
- Constant Field Values
-
BINARY_FORMAT
public static final int BINARY_FORMAT
- See Also:
- Constant Field Values
-
length
private final int length
-
oid
private final int oid
-
mod
private final int mod
-
columnLabel
private java.lang.String columnLabel
-
format
private int format
-
tableOid
private final int tableOid
-
positionInTable
private final int positionInTable
-
metadata
private FieldMetadata metadata
-
sqlType
private int sqlType
-
pgType
private java.lang.String pgType
-
NOT_YET_LOADED
private static final java.lang.String NOT_YET_LOADED
-
-
Constructor Detail
-
Field
public Field(java.lang.String name, int oid, int length, int mod)Construct a field based on the information fed to it.- Parameters:
name- the name (column name and label) of the fieldoid- the OID of the fieldlength- the length of the fieldmod- modifier
-
Field
public Field(java.lang.String name, int oid)Constructor without mod parameter.- Parameters:
name- the name (column name and label) of the fieldoid- the OID of the field
-
Field
public Field(java.lang.String columnLabel, int oid, int length, int mod, int tableOid, int positionInTable)Construct a field based on the information fed to it.- Parameters:
columnLabel- the column label of the fieldoid- the OID of the fieldlength- the length of the fieldmod- modifiertableOid- the OID of the columns' tablepositionInTable- the position of column in the table (first column is 1, second column is 2, etc...)
-
-
Method Detail
-
getOID
public int getOID()
Returns the oid of this Field's data type.- Returns:
- the oid of this Field's data type
-
getMod
public int getMod()
Returns the mod of this Field's data type- Returns:
- the mod of this Field's data type
-
getColumnLabel
public java.lang.String getColumnLabel()
Returns the column label of this Field's data type.- Returns:
- the column label of this Field's data type
-
getLength
public int getLength()
Returns the length of this Field's data type.- Returns:
- the length of this Field's data type
-
getFormat
public int getFormat()
Returns the format of this Field's data (text=0, binary=1).- Returns:
- the format of this Field's data (text=0, binary=1)
-
setFormat
public void setFormat(int format)
Sets the format of this Field's data (text=0, binary=1).- Parameters:
format- the format of this Field's data (text=0, binary=1)
-
getTableOid
public int getTableOid()
Returns the columns' table oid, zero if no oid available.- Returns:
- the columns' table oid, zero if no oid available
-
getPositionInTable
public int getPositionInTable()
-
getMetadata
public FieldMetadata getMetadata()
-
setMetadata
public void setMetadata(FieldMetadata metadata)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
setSQLType
public void setSQLType(int sqlType)
-
getSQLType
public int getSQLType()
-
setPGType
public void setPGType(java.lang.String pgType)
-
getPGType
public java.lang.String getPGType()
-
isTypeInitialized
public boolean isTypeInitialized()
-
upperCaseLabel
public void upperCaseLabel()
-
-