Package bbd.jportal2
Class Field
- java.lang.Object
-
- bbd.jportal2.Field
-
- All Implemented Interfaces:
Serializable
public class Field extends Object implements Serializable
This holds the field definition. It also supplies methods for the Java format and various SQL formats.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description StringaliasName to use in the class if not present (normal case) then name is usedstatic byteANSICHARstatic byteAUTOTIMESTAMPstatic byteBIGIDENTITYstatic byteBIGSEQUENCEstatic byteBIGXMLintbindPosstatic byteBLOBstatic byteBOOLEANstatic byteBYTEstatic byteCHARStringcheckValueCheck Constraint to applied to field by the databaseVector<String>commentsArray of comments associated with the fieldstatic byteDATEstatic byteDATETIMEstatic intDEFAULT_BIG_XMLstatic intDEFAULT_XMLStringdefaultValueDefault value to apply for the field on insert if not specifiedintdefinePosstatic byteDOUBLEstatic byteDYNAMICStringenumLinkVector<Enum>enumsStringenumTypestatic byteFLOATstatic byteIDENTITYstatic byteINTbooleanisCalcIndicates the field is a calculated column on the databasebooleanisExtStdIndicates the field is EXTbooleanisExtStdOutbooleanisInIndicates the field is INPUTbooleanisLiteralIndicates the field can is a LiteralbooleanisNullIndicates the field can be NULL on the databasebooleanisOutIndicates the field is OUTPUTbooleanisPrimaryKeyIndicates field is used in the primary keybooleanisSequenceIndicates the field is a SequenceintlengthLength of fieldStringliteralNamestatic byteLONGstatic byteMONEYStringnameName to use in the databaseintprecisionNo of digits in a numeric fieldintscaleNo of digits after the decimal point|commastatic byteSEQUENCEstatic byteSHORTstatic byteSTATUSstatic byteTIMEstatic byteTIMESTAMPstatic byteTLOBbytetypeType of fieldstatic byteUIDstatic byteUSERSTAMPstatic byteUTF8Vector<String>valueListstatic byteWANSICHARstatic byteWCHARstatic byteXML
-
Constructor Summary
Constructors Constructor Description Field()constructor ensures fields have correct default values
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanansiIsNull()Check for empty string as null type fields.StringgetAlias()intgetBindPos()StringgetCheckValue()Vector<String>getComments()StringgetDefaultValue()intgetDefinePos()StringgetEnumLink()Vector<Enum>getEnums()StringgetEnumType()intgetLength()StringgetLiteralName()StringgetName()intgetPrecision()intgetScale()bytegetType()Vector<String>getValueList()booleanisCalc()booleanisCharEmptyAsNull()Check for empty string as null type fields.booleanisCharEmptyOrAnsiAsNull()booleanisEmptyAsNull()Check for empty string as null type fields.booleanisEmptyOrAnsiAsNull()booleanisExtStd()booleanisExtStdOut()booleanisIn()booleanisLiteral()booleanisNull()booleanisOut()booleanisPrimaryKey()booleanisSequence()voidreader(DataInputStream ids)StringreplaceAll(String haystack, String needle, String replacement)voidsetEnumType(String enumType)StringuseLiteral()If there is an literal uses that else returns nameStringuseLowerName()If there is an alias uses that else returns nameStringuseName()If there is an alias uses that else returns nameStringuseUpperName()If there is an alias uses that else returns namevoidwriter(DataOutputStream ods)
-
-
-
Field Detail
-
name
public String name
Name to use in the database
-
alias
public String alias
Name to use in the class if not present (normal case) then name is used
-
defaultValue
public String defaultValue
Default value to apply for the field on insert if not specified
-
checkValue
public String checkValue
Check Constraint to applied to field by the database
-
type
public byte type
Type of field
-
length
public int length
Length of field
-
precision
public int precision
No of digits in a numeric field
-
scale
public int scale
No of digits after the decimal point|comma
-
bindPos
public int bindPos
-
definePos
public int definePos
-
enumLink
public String enumLink
-
enumType
public String enumType
-
isPrimaryKey
public boolean isPrimaryKey
Indicates field is used in the primary key
-
isSequence
public boolean isSequence
Indicates the field is a Sequence
-
isNull
public boolean isNull
Indicates the field can be NULL on the database
-
isLiteral
public boolean isLiteral
Indicates the field can is a Literal
-
isCalc
public boolean isCalc
Indicates the field is a calculated column on the database
-
isIn
public boolean isIn
Indicates the field is INPUT
-
isOut
public boolean isOut
Indicates the field is OUTPUT
-
isExtStd
public boolean isExtStd
Indicates the field is EXT
-
isExtStdOut
public boolean isExtStdOut
-
literalName
public String literalName
-
BLOB
public static final byte BLOB
- See Also:
- Constant Field Values
-
BOOLEAN
public static final byte BOOLEAN
- See Also:
- Constant Field Values
-
BYTE
public static final byte BYTE
- See Also:
- Constant Field Values
-
CHAR
public static final byte CHAR
- See Also:
- Constant Field Values
-
DATE
public static final byte DATE
- See Also:
- Constant Field Values
-
DATETIME
public static final byte DATETIME
- See Also:
- Constant Field Values
-
DOUBLE
public static final byte DOUBLE
- See Also:
- Constant Field Values
-
DYNAMIC
public static final byte DYNAMIC
- See Also:
- Constant Field Values
-
FLOAT
public static final byte FLOAT
- See Also:
- Constant Field Values
-
IDENTITY
public static final byte IDENTITY
- See Also:
- Constant Field Values
-
INT
public static final byte INT
- See Also:
- Constant Field Values
-
LONG
public static final byte LONG
- See Also:
- Constant Field Values
-
MONEY
public static final byte MONEY
- See Also:
- Constant Field Values
-
SEQUENCE
public static final byte SEQUENCE
- See Also:
- Constant Field Values
-
SHORT
public static final byte SHORT
- See Also:
- Constant Field Values
-
STATUS
public static final byte STATUS
- See Also:
- Constant Field Values
-
TIME
public static final byte TIME
- See Also:
- Constant Field Values
-
TIMESTAMP
public static final byte TIMESTAMP
- See Also:
- Constant Field Values
-
TLOB
public static final byte TLOB
- See Also:
- Constant Field Values
-
USERSTAMP
public static final byte USERSTAMP
- See Also:
- Constant Field Values
-
ANSICHAR
public static final byte ANSICHAR
- See Also:
- Constant Field Values
-
UID
public static final byte UID
- See Also:
- Constant Field Values
-
XML
public static final byte XML
- See Also:
- Constant Field Values
-
BIGSEQUENCE
public static final byte BIGSEQUENCE
- See Also:
- Constant Field Values
-
BIGIDENTITY
public static final byte BIGIDENTITY
- See Also:
- Constant Field Values
-
AUTOTIMESTAMP
public static final byte AUTOTIMESTAMP
- See Also:
- Constant Field Values
-
WCHAR
public static final byte WCHAR
- See Also:
- Constant Field Values
-
WANSICHAR
public static final byte WANSICHAR
- See Also:
- Constant Field Values
-
UTF8
public static final byte UTF8
- See Also:
- Constant Field Values
-
BIGXML
public static final byte BIGXML
- See Also:
- Constant Field Values
-
DEFAULT_XML
public static final int DEFAULT_XML
- See Also:
- Constant Field Values
-
DEFAULT_BIG_XML
public static final int DEFAULT_BIG_XML
- See Also:
- Constant Field Values
-
-
Method Detail
-
getName
public String getName()
-
getAlias
public String getAlias()
-
getDefaultValue
public String getDefaultValue()
-
getCheckValue
public String getCheckValue()
-
getType
public byte getType()
-
getLength
public int getLength()
-
getPrecision
public int getPrecision()
-
getScale
public int getScale()
-
getBindPos
public int getBindPos()
-
getDefinePos
public int getDefinePos()
-
getEnumLink
public String getEnumLink()
-
getEnumType
public String getEnumType()
-
setEnumType
public void setEnumType(String enumType)
-
isPrimaryKey
public boolean isPrimaryKey()
-
isSequence
public boolean isSequence()
-
isNull
public boolean isNull()
-
isLiteral
public boolean isLiteral()
-
isCalc
public boolean isCalc()
-
isIn
public boolean isIn()
-
isOut
public boolean isOut()
-
isExtStd
public boolean isExtStd()
-
isExtStdOut
public boolean isExtStdOut()
-
getLiteralName
public String getLiteralName()
-
reader
public void reader(DataInputStream ids) throws IOException
- Throws:
IOException
-
writer
public void writer(DataOutputStream ods) throws IOException
- Throws:
IOException
-
useName
public String useName()
If there is an alias uses that else returns name
-
useLiteral
public String useLiteral()
If there is an literal uses that else returns name
-
useLowerName
public String useLowerName()
If there is an alias uses that else returns name
-
useUpperName
public String useUpperName()
If there is an alias uses that else returns name
-
isEmptyAsNull
public boolean isEmptyAsNull()
Check for empty string as null type fields.
-
isCharEmptyAsNull
public boolean isCharEmptyAsNull()
Check for empty string as null type fields.
-
ansiIsNull
public boolean ansiIsNull()
Check for empty string as null type fields.
-
isEmptyOrAnsiAsNull
public boolean isEmptyOrAnsiAsNull()
-
isCharEmptyOrAnsiAsNull
public boolean isCharEmptyOrAnsiAsNull()
-
-