Package org.hibernate.mapping
Class Column
- java.lang.Object
-
- org.hibernate.mapping.Column
-
- All Implemented Interfaces:
Serializable,Cloneable,Selectable
- Direct Known Subclasses:
ExportableColumn
public class Column extends Object implements Selectable, Serializable, Cloneable
A column of a relational database table- See Also:
- Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description StringcheckConstraint()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 tablesStringgetCanonicalName()StringgetCheckConstraint()SizegetColumnSize(Dialect dialect, Mapping mapping)StringgetComment()StringgetCustomRead()StringgetCustomReadExpression()Any custom read expression for this selectable.StringgetCustomWrite()StringgetCustomWriteExpression()Any custom write expression for this selectable.StringgetDefaultValue()StringgetGeneratedAs()LonggetLength()StringgetName()IntegergetPrecision()StringgetQuotedName()returns quoted name as it would be in the mapping file.StringgetQuotedName(Dialect d)StringgetReadExpr(Dialect dialect)IntegergetScale()StringgetSqlType()StringgetSqlType(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping)IntegergetSqlTypeCode()Returns the underlying columns SqlTypeCode.intgetSqlTypeCode(Mapping mapping)StringgetTemplate(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry functionRegistry)StringgetText()The selectable's "canonical" text representationStringgetText(Dialect d)The selectable's text representation accounting for the Dialect's quoting, if quotedintgetTypeIndex()ValuegetValue()StringgetWriteExpr()booleanhasCheckConstraint()booleanhasCustomRead()inthashCode()booleanisFormula()Does this selectable represent a formula?trueindicates it is a formula;falseindicates it is a physical columnbooleanisNullable()booleanisQuoted()booleanisUnique()voidsetCheckConstraint(String checkConstraint)voidsetComment(String comment)voidsetCustomRead(String customRead)voidsetCustomWrite(String customWrite)voidsetDefaultValue(String defaultValue)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 sqlType)voidsetSqlTypeCode(Integer typeCode)voidsetTypeIndex(int typeIndex)voidsetUnique(boolean unique)voidsetValue(Value value)StringtoString()
-
-
-
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)
-
getValue
public Value getValue()
-
setValue
public void setValue(Value value)
-
getName
public String getName()
-
setName
public void setName(String name)
-
getQuotedName
public String getQuotedName()
returns quoted name as it would be in the mapping file.
-
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 the underlying columns SqlTypeCode. If null, it is because the SqlTypeCode is unknown. Use #getSqlTypeCode(Mapping) to retrieve the SqlTypeCode used for the columns associated Value/Type.- Returns:
- sqlTypeCode if it is set, otherwise null.
-
setSqlTypeCode
public void setSqlTypeCode(Integer typeCode)
-
getSqlType
public String getSqlType(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping) throws HibernateException
- Throws:
HibernateException
-
getSqlType
public String getSqlType()
-
setSqlType
public void setSqlType(String sqlType)
-
setUnique
public void setUnique(boolean unique)
-
isQuoted
public boolean isQuoted()
-
getCheckConstraint
public String getCheckConstraint()
-
setCheckConstraint
public void setCheckConstraint(String checkConstraint)
-
hasCheckConstraint
public boolean hasCheckConstraint()
-
checkConstraint
public String checkConstraint()
-
getTemplate
public String getTemplate(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry functionRegistry)
- Specified by:
getTemplatein interfaceSelectable
-
hasCustomRead
public boolean hasCustomRead()
-
getWriteExpr
public String getWriteExpr()
-
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 d)
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)
-
getComment
public String getComment()
-
setComment
public void setComment(String comment)
-
getDefaultValue
public String getDefaultValue()
-
setDefaultValue
public void setDefaultValue(String defaultValue)
-
getGeneratedAs
public String getGeneratedAs()
-
setGeneratedAs
public void setGeneratedAs(String generatedAs)
-
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()
-
-