Package org.hibernate.mapping
Class Column
java.lang.Object
org.hibernate.mapping.Column
- All Implemented Interfaces:
Serializable,Cloneable,Selectable,ColumnTypeInformation
- Direct Known Subclasses:
AggregateColumn
public sealed class Column
extends Object
implements Selectable, Serializable, Cloneable, ColumnTypeInformation
permits AggregateColumn
- See Also:
-
Field Summary
Fields inherited from interface org.hibernate.tool.schema.extract.spi.ColumnTypeInformation
EMPTY -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCheckConstraint(CheckConstraint checkConstraint) clone()Shallow copy, the value is not copiedbooleanbooleanGenerate a column alias that is unique across multiple tablesintThe column size (length).getColumnSize(Dialect dialect, MappingContext mappingContext) Any custom read expression for this selectable.Any custom write expression for this selectable.intThe precision, for numeric typesgetName()getNameIdentifier(MetadataBuildingContext buildingContext) Is the column nullable?getQuotedName(Dialect dialect) getReadExpr(Dialect dialect) getScale()getSqlType(Metadata mapping) Returns SQL type code for this column, ornullif the type code is unknown.intgetSqlTypeCode(MappingContext mapping) getTemplate(Dialect dialect, TypeConfiguration typeConfiguration) getText()The selectable's "canonical" text representationThe selectable's text representation accounting for the Dialect's quoting, if quotedgetType()intThe JDBC type-code.intThe database specific type name.getValue()booleanbooleaninthashCode()booleanbooleanDoes this selectable represent a formula?trueindicates it is a formula;falseindicates it is a physical columnbooleanbooleanbooleanisQuoted()booleanbooleanisSqlTypeLob(Metadata mapping) booleanisUnique()voidsetArrayLength(Integer arrayLength) voidsetAssignmentExpression(String assignmentExpression) voidsetCollation(String collation) voidsetComment(String comment) voidsetCustomRead(String customRead) voidsetCustomWrite(String customWrite) voidsetDefaultValue(String defaultValue) voidsetExplicit(boolean explicit) voidsetGeneratedAs(String generatedAs) voidsetIdentity(boolean identity) voidvoidvoidvoidsetNullable(boolean nullable) voidsetOptions(String options) voidsetPrecision(Integer precision) voidsetResolvedCustomRead(String customRead) voidvoidsetSqlType(String typeName) voidsetSqlTypeCode(Integer typeCode) voidsetTemporalPrecision(Integer temporalPrecision) voidsetTypeIndex(int typeIndex) voidsetUnique(boolean unique) voidsetUniqueKeyName(String keyName) voidtoString()Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface org.hibernate.mapping.Selectable
getWriteExpr
-
Constructor Details
-
Column
public Column() -
Column
-
-
Method Details
-
getLength
-
setLength
-
setLength
-
getArrayLength
-
setArrayLength
-
getValue
-
setValue
-
getType
-
getName
-
setName
-
getNameIdentifier
-
isExplicit
public boolean isExplicit() -
setExplicit
public void setExplicit(boolean explicit) -
isIdentity
public boolean isIdentity() -
setIdentity
public void setIdentity(boolean identity) -
getQuotedName
- Returns:
- the quoted name as it would occur in the mapping file
-
getQuotedName
- Returns:
- the quoted name using the quoting syntax of the given dialect
-
getAlias
- Specified by:
getAliasin interfaceSelectable
-
getAlias
Generate a column alias that is unique across multiple tables- Specified by:
getAliasin interfaceSelectable
-
isNullable
public boolean isNullable() -
setNullable
public void setNullable(boolean nullable) -
getTypeIndex
public int getTypeIndex() -
setTypeIndex
public void setTypeIndex(int typeIndex) -
isUnique
public boolean isUnique() -
hashCode
public int hashCode() -
equals
-
equals
-
getSqlTypeCode
- Throws:
MappingException
-
getSqlTypeCode
Returns SQL type code for this column, ornullif the type code is unknown.Use
getSqlTypeCode(MappingContext)to retrieve the type code usingValueassociated with the column.- Returns:
- the type code, if it is set, otherwise null.
-
setSqlTypeCode
-
getSqlType
-
getTypeName
Description copied from interface:ColumnTypeInformationThe database specific type name.- Specified by:
getTypeNamein interfaceColumnTypeInformation- Returns:
- Type name
-
getNullable
Description copied from interface:ColumnTypeInformationIs the column nullable?The database is allowed to report unknown, hence the use of
Boolean.- Specified by:
getNullablein interfaceColumnTypeInformation- Returns:
- nullability, if known
-
getTypeCode
public int getTypeCode()Description copied from interface:ColumnTypeInformationThe JDBC type-code.- Specified by:
getTypeCodein interfaceColumnTypeInformation- Returns:
- JDBC type-code
-
getColumnSize
public int getColumnSize()Description copied from interface:ColumnTypeInformationThe column size (length).- Specified by:
getColumnSizein interfaceColumnTypeInformation- Returns:
- The column length
-
getDecimalDigits
public int getDecimalDigits()Description copied from interface:ColumnTypeInformationThe precision, for numeric types- Specified by:
getDecimalDigitsin interfaceColumnTypeInformation- Returns:
- The numeric precision
-
getColumnSize
-
getSqlType
-
setSqlType
-
isSqlTypeLob
public boolean isSqlTypeLob() -
isSqlTypeLob
-
setUnique
public void setUnique(boolean unique) -
getUniqueKeyName
-
setUniqueKeyName
-
isQuoted
public boolean isQuoted() -
toString
-
addCheckConstraint
-
getCheckConstraints
-
hasCheckConstraint
public boolean hasCheckConstraint() -
getTemplate
- Specified by:
getTemplatein interfaceSelectable
-
hasCustomRead
public boolean hasCustomRead() -
getReadExpr
-
getWriteExpr
- Specified by:
getWriteExprin interfaceSelectable
-
isFormula
public boolean isFormula()Description copied from interface:SelectableDoes this selectable represent a formula?trueindicates it is a formula;falseindicates it is a physical column- Specified by:
isFormulain interfaceSelectable
-
getText
Description copied from interface:SelectableThe selectable's text representation accounting for the Dialect's quoting, if quoted- Specified by:
getTextin interfaceSelectable
-
getText
Description copied from interface:SelectableThe selectable's "canonical" text representation- Specified by:
getTextin interfaceSelectable
-
getCustomReadExpression
Description copied from interface:SelectableAny custom read expression for this selectable. Only pertinent for physical columns (not formulas)- Specified by:
getCustomReadExpressionin interfaceSelectable- See Also:
-
getCustomWriteExpression
Description copied from interface:SelectableAny custom write expression for this selectable. Only pertinent for physical columns (not formulas)- Specified by:
getCustomWriteExpressionin interfaceSelectable- See Also:
-
getPrecision
-
setPrecision
-
getScale
-
setScale
-
getTemporalPrecision
-
setTemporalPrecision
-
getComment
-
setComment
-
getCollation
-
setCollation
-
getDefaultValue
-
setDefaultValue
-
getGeneratedAs
-
setGeneratedAs
-
getAssignmentExpression
-
setAssignmentExpression
-
getCustomWrite
-
setCustomWrite
-
getCustomRead
-
setResolvedCustomRead
-
setCustomRead
-
getCanonicalName
-
getOptions
-
setOptions
-
clone
Shallow copy, the value is not copied
-