Package org.hibernate.mapping
Class Column
- java.lang.Object
-
- org.hibernate.mapping.Column
-
- All Implemented Interfaces:
Serializable,Cloneable,Selectable,ColumnTypeInformation
- Direct Known Subclasses:
AggregateColumn,ExportableColumn
public class Column extends Object implements Selectable, Serializable, Cloneable, ColumnTypeInformation
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from interface org.hibernate.tool.schema.extract.spi.ColumnTypeInformation
EMPTY
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddCheckConstraint(CheckConstraint checkConstraint)StringcheckConstraint()Deprecated.Columnclone()Shallow copy, the value is not copiedbooleanequals(Object object)booleanequals(Column column)StringgetAlias(Dialect dialect)StringgetAlias(Dialect dialect, Table table)Generate a column alias that is unique across multiple tablesIntegergetArrayLength()StringgetAssignmentExpression()StringgetCanonicalName()StringgetCheckConstraint()Deprecated.List<CheckConstraint>getCheckConstraints()StringgetCollation()intgetColumnSize()The column size (length).SizegetColumnSize(Dialect dialect, Mapping mapping)StringgetComment()StringgetCustomRead()StringgetCustomReadExpression()Any custom read expression for this selectable.StringgetCustomWrite()StringgetCustomWriteExpression()Any custom write expression for this selectable.intgetDecimalDigits()The precision, for numeric typesStringgetDefaultValue()StringgetGeneratedAs()LonggetLength()StringgetName()IdentifiergetNameIdentifier(MetadataBuildingContext buildingContext)TruthValuegetNullable()Is the column nullable.IntegergetPrecision()StringgetQuotedName()StringgetQuotedName(Dialect dialect)StringgetReadExpr(Dialect dialect)IntegergetScale()StringgetSqlType()StringgetSqlType(Metadata mapping)StringgetSqlType(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping)Deprecated.IntegergetSqlTypeCode()Returns SQL type code for this column, ornullif the type code is unknown.intgetSqlTypeCode(Mapping mapping)StringgetTemplate(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry registry)IntegergetTemporalPrecision()StringgetText()The selectable's "canonical" text representationStringgetText(Dialect dialect)The selectable's text representation accounting for the Dialect's quoting, if quotedintgetTypeCode()The JDBC type-code.intgetTypeIndex()StringgetTypeName()The database specific type name.StringgetUniqueKeyName()ValuegetValue()StringgetWriteExpr()booleanhasCheckConstraint()booleanhasCustomRead()inthashCode()booleanisExplicit()booleanisFormula()Does this selectable represent a formula?trueindicates it is a formula;falseindicates it is a physical columnbooleanisNullable()booleanisQuoted()booleanisSqlTypeLob()booleanisSqlTypeLob(Metadata mapping)booleanisUnique()voidsetArrayLength(Integer arrayLength)voidsetAssignmentExpression(String assignmentExpression)voidsetCheckConstraint(String constraint)Deprecated.voidsetCollation(String collation)voidsetComment(String comment)voidsetCustomRead(String customRead)voidsetCustomWrite(String customWrite)voidsetDefaultValue(String defaultValue)voidsetExplicit(boolean explicit)voidsetGeneratedAs(String generatedAs)voidsetLength(Integer length)voidsetLength(Long length)voidsetName(String name)voidsetNullable(boolean nullable)voidsetPrecision(Integer precision)voidsetResolvedCustomRead(String customRead)voidsetScale(Integer scale)voidsetSqlType(String typeName)voidsetSqlTypeCode(Integer typeCode)voidsetTemporalPrecision(Integer temporalPrecision)voidsetTypeIndex(int typeIndex)voidsetUnique(boolean unique)voidsetUniqueKeyName(String keyName)voidsetValue(Value value)StringtoString()-
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.mapping.Selectable
getWriteExpr
-
-
-
-
Constructor Detail
-
Column
public Column()
-
Column
public Column(String columnName)
-
-
Method Detail
-
getLength
public Long getLength()
-
setLength
public void setLength(Long length)
-
setLength
public void setLength(Integer length)
-
getArrayLength
public Integer getArrayLength()
-
setArrayLength
public void setArrayLength(Integer arrayLength)
-
getValue
public Value getValue()
-
setValue
public void setValue(Value value)
-
getName
public String getName()
-
setName
public void setName(String name)
-
getNameIdentifier
@Internal public Identifier getNameIdentifier(MetadataBuildingContext buildingContext)
-
isExplicit
public boolean isExplicit()
-
setExplicit
public void setExplicit(boolean explicit)
-
getQuotedName
public String getQuotedName()
- Returns:
- the quoted name as it would occur in the mapping file
-
getQuotedName
public String getQuotedName(Dialect dialect)
- Returns:
- the quoted name using the quoting syntax of the given dialect
-
getAlias
public String getAlias(Dialect dialect)
- Specified by:
getAliasin interfaceSelectable
-
getAlias
public String getAlias(Dialect dialect, Table table)
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()
-
equals
public boolean equals(Column column)
-
getSqlTypeCode
public int getSqlTypeCode(Mapping mapping) throws MappingException
- Throws:
MappingException
-
getSqlTypeCode
public Integer getSqlTypeCode()
Returns SQL type code for this column, ornullif the type code is unknown.Use
getSqlTypeCode(Mapping)to retrieve the type code usingValueassociated with the column.- Returns:
- the type code, if it is set, otherwise null.
-
setSqlTypeCode
public void setSqlTypeCode(Integer typeCode)
-
getSqlType
@Deprecated(since="6.2") public String getSqlType(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping)
Deprecated.
-
getTypeName
public String getTypeName()
Description copied from interface:ColumnTypeInformationThe database specific type name.- Specified by:
getTypeNamein interfaceColumnTypeInformation- Returns:
- Type name
-
getNullable
public TruthValue getNullable()
Description copied from interface:ColumnTypeInformationIs the column nullable. The database is allowed to report unknown, hence the use of TruthValue- Specified by:
getNullablein interfaceColumnTypeInformation- Returns:
- nullability.
-
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
-
getSqlType
public String getSqlType()
-
setSqlType
public void setSqlType(String typeName)
-
isSqlTypeLob
public boolean isSqlTypeLob()
-
isSqlTypeLob
public boolean isSqlTypeLob(Metadata mapping)
-
setUnique
public void setUnique(boolean unique)
-
getUniqueKeyName
public String getUniqueKeyName()
-
setUniqueKeyName
public void setUniqueKeyName(String keyName)
-
isQuoted
public boolean isQuoted()
-
addCheckConstraint
public void addCheckConstraint(CheckConstraint checkConstraint)
-
getCheckConstraints
public List<CheckConstraint> getCheckConstraints()
-
getCheckConstraint
@Deprecated(since="6.2") public String getCheckConstraint()
Deprecated.
-
setCheckConstraint
@Deprecated(since="6.2") public void setCheckConstraint(String constraint)
Deprecated.
-
hasCheckConstraint
public boolean hasCheckConstraint()
-
checkConstraint
@Deprecated(since="6.2") public String checkConstraint()
Deprecated.
-
getTemplate
public String getTemplate(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry registry)
- Specified by:
getTemplatein interfaceSelectable
-
hasCustomRead
public boolean hasCustomRead()
-
getWriteExpr
public String 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
public String getText(Dialect dialect)
Description copied from interface:SelectableThe selectable's text representation accounting for the Dialect's quoting, if quoted- Specified by:
getTextin interfaceSelectable
-
getText
public String getText()
Description copied from interface:SelectableThe selectable's "canonical" text representation- Specified by:
getTextin interfaceSelectable
-
getCustomReadExpression
public String 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:
ColumnTransformer
-
getCustomWriteExpression
public String 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:
ColumnTransformer
-
getPrecision
public Integer getPrecision()
-
setPrecision
public void setPrecision(Integer precision)
-
getScale
public Integer getScale()
-
setScale
public void setScale(Integer scale)
-
getTemporalPrecision
public Integer getTemporalPrecision()
-
setTemporalPrecision
public void setTemporalPrecision(Integer temporalPrecision)
-
getComment
public String getComment()
-
setComment
public void setComment(String comment)
-
getCollation
public String getCollation()
-
setCollation
public void setCollation(String collation)
-
getDefaultValue
public String getDefaultValue()
-
setDefaultValue
public void setDefaultValue(String defaultValue)
-
getGeneratedAs
public String getGeneratedAs()
-
setGeneratedAs
public void setGeneratedAs(String generatedAs)
-
getAssignmentExpression
public String getAssignmentExpression()
-
setAssignmentExpression
public void setAssignmentExpression(String assignmentExpression)
-
getCustomWrite
public String getCustomWrite()
-
setCustomWrite
public void setCustomWrite(String customWrite)
-
getCustomRead
public String getCustomRead()
-
setResolvedCustomRead
public void setResolvedCustomRead(String customRead)
-
setCustomRead
public void setCustomRead(String customRead)
-
getCanonicalName
public String getCanonicalName()
-
-