public class SqlField extends SqlColumn
Modifier and Type | Field and Description |
---|---|
protected int |
hashInt
The hash int.
|
protected String |
hashString
The hash string.
|
validationPattern
expression
ASEXPRESSION, defaultClauseStringBuilderLength, defaultExpressionStringBuilderLength, defaultQueryStringBuilderLength, DELIMIT_ALIASES, DELIMIT_COLUMN_IDENTIFIERS, DELIMIT_TABLE_IDENTIFIERS, ESCAPE_DBL_QUOTES, ESCAPE_QUOTES, FLAGS_TAKEN, MINIINDENT, OMITALIAS, PACKED, QUALIFY_BY_TABLE, SINGLELINE, UNQUALIFIED
Constructor and Description |
---|
SqlField(String fieldname,
SQL.DATATYPE type,
int typeLength,
Integer precision,
Integer scale,
boolean notNull,
boolean unique,
Object defaultValue)
Instantiates a new sql field.
|
Modifier and Type | Method and Description |
---|---|
StringBuilder |
assembleTableClassCode(StringBuilder sb,
int paddingSpaces)
Assemble table class code.
|
StringBuilder |
assembleType(StringBuilder sb,
DbmsAdaptor<?> dbmsAdaptor)
Assemble type.
|
String |
buildHash()
Builds the hash.
|
boolean |
equals(Object obj) |
String |
getCompareString()
Gets the compare string.
|
String |
getCreationCheckString(DbmsAdaptor<?> dbmsAdaptor)
Gets the creation check string.
|
String |
getCustomString()
Gets the custom string.
|
Object |
getDefaultValue()
Gets the default value.
|
String |
getName()
Gets the name.
|
SQL.DATATYPE |
getType()
Gets the type.
|
int |
getTypeLength()
Gets the type length.
|
int |
hashCode() |
boolean |
isNotNull()
Checks if is not null.
|
boolean |
isUnique()
Checks if is unique.
|
void |
resetHash()
Reset hash.
|
SqlField |
setCustomString(String customString)
Sets the custom string.
|
SqlField |
setDelimited(boolean delimited) |
SqlField |
setName(String name)
Sets the name.
|
SqlField |
setNotNull(boolean notNull)
Sets the not null.
|
void |
setOwner(TableExpression owner)
Sets the owner.
|
void |
setUnique(boolean unique)
Sets the unique.
|
ColumnDefinition |
toColumnDefinition()
To column definition.
|
assemble, createSqlColumn, getColumnName, getOwner, isDelimited, needsDelimiting, value, wrap, wrap
validateIdentifierString
_ASC, _DESC, _NULLS_FIRST, _NULLS_LAST, AS, BETWEEN, c, CONCAT, CONTAINS, copy, copyAS, eq, getExpression, getExpressionObject, gt, gte, IN, IS_NOT_NULL, IS_NULL, LIKE, lt, lte, ne, NOT_BETWEEN, NOT_CONTAINS, NOT_IN, NOT_LIKE, o, toString
assembleAlias, assembleObject, assembleQuery, bitAsExpression, bitDelimitAliases, bitDelimitColumnIdentifiers, bitDelimitTableIdentifiers, bitEscapeDoubleQuotes, bitMiniIndent, bitOmitAlias, bitPacked, bitQualified, bitQualifyByTable, bitSingleLine, concat, concatSqlExpressions, EscapeQuotes, flagsToString, function, indent, isAsExpression, isDelimitAliases, isDelimitColumnIdentifiers, isDelimitTableIdentifiers, isEscapeDoubleQuotes, isEscapeQuotes, isMiniIndent, isOmitAlias, isPacked, isQualifyByTable, isSingleLine, isUnqualified, keyword, list, printFlags, setAsExpression, setDelimitAliases, setDelimitColumnIdentifiers, setDelimitTableIdentifiers, setEscapeDoubleQuotes, setEscapeQuotes, setMiniIndent, setPacked, setQualified, setQualifyByTable, setSingleLine, setUseAlias
protected int hashInt
protected String hashString
public SqlField(String fieldname, SQL.DATATYPE type, int typeLength, Integer precision, Integer scale, boolean notNull, boolean unique, Object defaultValue) throws SQLEngineInvalidIdentifier
fieldname
- the fieldnametype
- the typetypeLength
- the type lengthprecision
- the precisionscale
- the scalenotNull
- the not nullunique
- the uniquedefaultValue
- the default valueSQLEngineInvalidIdentifier
- the sQL engine invalid identifierpublic String getCustomString()
public final SQL.DATATYPE getType()
public final boolean isNotNull()
public final boolean isUnique()
public final String getName()
public final Object getDefaultValue()
public final String getCompareString()
public final int getTypeLength()
public SqlField setCustomString(String customString)
customString
- the custom stringpublic final SqlField setNotNull(boolean notNull)
notNull
- the not nullpublic final void setOwner(TableExpression owner)
SqlColumn
setOwner
in class SqlColumn
owner
- SqlColumn.setOwner(com.xdev.jadoth.sqlengine.internal.interfaces.TableExpression)
public final SqlField setName(String name)
name
- the namepublic SqlField setDelimited(boolean delimited)
setDelimited
in class SqlColumn
public final void setUnique(boolean unique)
unique
- the new uniquepublic final boolean equals(Object obj)
equals
in class Object
obj
- Object.equals(java.lang.Object)
public final int hashCode()
hashCode
in class Object
Object.hashCode()
public final StringBuilder assembleType(StringBuilder sb, DbmsAdaptor<?> dbmsAdaptor)
sb
- the sbdbmsAdaptor
- the dbms adaptorpublic final String getCreationCheckString(DbmsAdaptor<?> dbmsAdaptor)
dbmsAdaptor
- the dbms adaptorpublic final String buildHash()
public final void resetHash()
public final StringBuilder assembleTableClassCode(StringBuilder sb, int paddingSpaces)
sb
- the sbpaddingSpaces
- the padding spacespublic ColumnDefinition toColumnDefinition()
Copyright © 2003–2023 XDEV Software. All rights reserved.