Top Description Fields Constructors Methods
org.hibernate.mapping

public Class Column

extends Object
implements Selectable, Serializable, Cloneable, ColumnTypeInformation
Class Inheritance
All Implemented Interfaces
org.hibernate.tool.schema.extract.spi.ColumnTypeInformation, java.lang.Cloneable, java.io.Serializable, org.hibernate.mapping.Selectable
Known Direct Subclasses
org.hibernate.id.ExportableColumn, org.hibernate.mapping.AggregateColumn
Imports
java.io.Serializable, java.sql.Types, java.util.ArrayList, .Locale, .Objects, org.hibernate.AssertionFailure, .MappingException, org.hibernate.boot.Metadata, org.hibernate.boot.model.TruthValue, org.hibernate.boot.model.relational.Database, org.hibernate.dialect.Dialect, org.hibernate.engine.jdbc.Size, org.hibernate.engine.spi.Mapping, org.hibernate.loader.internal.AliasConstantsHelper, org.hibernate.metamodel.mapping.JdbcMapping, org.hibernate.query.sqm.function.SqmFunctionRegistry, org.hibernate.sql.Template, org.hibernate.tool.schema.extract.spi.ColumnTypeInformation, org.hibernate.type.ComponentType, .EntityType, .Type, org.hibernate.type.descriptor.JdbcTypeNameMapper, org.hibernate.type.descriptor.jdbc.JdbcType, org.hibernate.type.descriptor.sql.DdlType, org.hibernate.type.descriptor.sql.spi.DdlTypeRegistry, org.hibernate.type.spi.TypeConfiguration

A mapping model object representing a column of a relational database table.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private Integer
private String
private List<CheckConstraint>
private String
private Size
private String
private String
private String
private String
private boolean
private String
private Long
private String
private boolean
private Integer
private boolean
private Integer
private Integer
private Boolean
private String
private int
private boolean
pack-priv int
private Value

Constructor Summary

AccessConstructor and Description
public
public
Column(String columnName)

Method Summary

Modifier and TypeMethod and Description
public void
pack-priv Size
calculateColumnSize(Dialect dialect, Mapping mapping)

Deprecated as a consequence of Mapping being deprecated.
public String
checkConstraint()

Deprecated since 6.2.
public Column
clone()

Overrides java.lang.Object.clone.

Shallow copy, the value is not copied
public boolean
equals(Object
the reference object with which to compare.
object
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public boolean
equals(Column column)

public String
public String
getAlias(Dialect dialect, Table table)

Implements org.hibernate.mapping.Selectable.getAlias.

Generate a column alias that is unique across multiple tables
public Integer
public String
public String
public String
getCheckConstraint()

Deprecated since 6.2.
public List<CheckConstraint>
public String
public int
public Size
getColumnSize(Dialect dialect, Mapping mapping)

Deprecated as a consequence of Mapping being deprecated.
public String
public String
public String
getCustomReadExpression()

Implements org.hibernate.mapping.Selectable.getCustomReadExpression.

Any custom read expression for this selectable.
public String
public String
getCustomWriteExpression()

Implements org.hibernate.mapping.Selectable.getCustomWriteExpression.

Any custom write expression for this selectable.
public int
public String
public String
public Long
public String
public TruthValue
public Integer
public String

Returns:

the quoted name as it would occur in the mapping file
getQuotedName
()

public String

Returns:

the quoted name using the quoting syntax of the given dialect
getQuotedName
(Dialect dialect)

public String
public Integer
public String
getSqlType(Metadata mapping)

Deprecated as a consequence of Metadata being deprecated.
public String
getSqlType(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping)

Deprecated since 6.2. use getSqlType(Metadata)
public String
public int
getSqlTypeCode(Mapping mapping)

Deprecated as a consequence of Mapping being deprecated.
public Integer

Returns:

the type code, if it is set, otherwise null.
getSqlTypeCode
()

Returns SQL type code for this column, or null if the type code is unknown.

private String
getSqlTypeName(DdlTypeRegistry ddlTypeRegistry, Dialect dialect, Mapping mapping)

Deprecated as a consequence of Mapping being deprecated.
public String
public String
getText(Dialect dialect)

Implements org.hibernate.mapping.Selectable.getText.

The selectable's text representation accounting for the Dialect's quoting, if quoted
public String
getText()

Implements org.hibernate.mapping.Selectable.getText.

The selectable's "canonical" text representation
public int
private Type
getTypeForComponentValue(Mapping mapping, Type type, int typeIndex)

Deprecated as a consequence of Mapping being deprecated.
private Type
getTypeForEntityValue(Mapping mapping, Type type, int typeIndex)

Deprecated as a consequence of Mapping being deprecated.
public int
public String
private static Type
getUnderlyingType(Mapping mapping, Type type, int typeIndex)

Deprecated as a consequence of Mapping being deprecated.
public Value
public String
public boolean
public boolean
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
private static boolean
isCloseQuote(char ch)

public boolean
public boolean
isFormula()

Implements org.hibernate.mapping.Selectable.isFormula.

Does this selectable represent a formula?
public boolean
private static boolean
isOpenQuote(char ch)

private static boolean
public boolean
public boolean
public boolean
isSqlTypeLob(Metadata mapping)

Deprecated as a consequence of Metadata being deprecated.
public boolean
public void
setArrayLength(Integer arrayLength)

public void
setAssignmentExpression(String assignmentExpression)

public void
setCheckConstraint(String constraint)

Deprecated since 6.2.
public void
setCollation(String collation)

public void
setComment(String comment)

public void
setCustomRead(String customRead)

public void
setCustomWrite(String customWrite)

public void
setDefaultValue(String defaultValue)

public void
setExplicit(boolean explicit)

public void
setGeneratedAs(String generatedAs)

public void
setLength(Long length)

public void
public void
public void
setNullable(boolean nullable)

public void
setPrecision(Integer precision)

public void
public void
public void
setSqlType(String typeName)

public void
public void
setTypeIndex(int typeIndex)

public void
setUnique(boolean unique)

public void
setValue(Value value)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
finalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

arrayLengthback to summary
private Integer arrayLength
assignmentExpressionback to summary
private String assignmentExpression
checkConstraintsback to summary
private List<CheckConstraint> checkConstraints
collationback to summary
private String collation
columnSizeback to summary
private Size columnSize
commentback to summary
private String comment
customReadback to summary
private String customRead
customWriteback to summary
private String customWrite
defaultValueback to summary
private String defaultValue
explicitback to summary
private boolean explicit
generatedAsback to summary
private String generatedAs
lengthback to summary
private Long length
nameback to summary
private String name
nullableback to summary
private boolean nullable
precisionback to summary
private Integer precision
quotedback to summary
private boolean quoted
scaleback to summary
private Integer scale
sqlTypeCodeback to summary
private Integer sqlTypeCode
sqlTypeLobback to summary
private Boolean sqlTypeLob
sqlTypeNameback to summary
private String sqlTypeName
typeIndexback to summary
private int typeIndex
uniqueback to summary
private boolean unique
uniqueIntegerback to summary
pack-priv int uniqueInteger
valueback to summary
private Value value

Constructor Detail

Columnback to summary
public Column()
Columnback to summary
public Column(String columnName)

Method Detail

addCheckConstraintback to summary
public void addCheckConstraint(CheckConstraint checkConstraint)
calculateColumnSizeback to summary
pack-priv Size calculateColumnSize(Dialect dialect, Mapping mapping)

Deprecated

as a consequence of Mapping being deprecated. See corresponding docs for further information.

checkConstraintback to summary
public String checkConstraint()

Deprecated

since 6.2.

Annotations
@Deprecated
since:6.2
cloneback to summary
public Column clone()

Overrides java.lang.Object.clone.

Shallow copy, the value is not copied

Returns:Column

Doc from java.lang.Object.clone.

a clone of this instance.

Annotations
@Override
equalsback to summary
public boolean equals(Object object)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
object:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
equalsback to summary
public boolean equals(Column column)
getAliasback to summary
public String getAlias(Dialect dialect)

Implements org.hibernate.mapping.Selectable.getAlias.

Annotations
@Override
getAliasback to summary
public String getAlias(Dialect dialect, Table table)

Implements org.hibernate.mapping.Selectable.getAlias.

Generate a column alias that is unique across multiple tables

Annotations
@Override
getArrayLengthback to summary
public Integer getArrayLength()
getAssignmentExpressionback to summary
public String getAssignmentExpression()
getCanonicalNameback to summary
public String getCanonicalName()
getCheckConstraintback to summary
public String getCheckConstraint()

Deprecated

since 6.2.

Annotations
@Deprecated
since:6.2
getCheckConstraintsback to summary
public List<CheckConstraint> getCheckConstraints()
getCollationback to summary
public String getCollation()
getColumnSizeback to summary
public int getColumnSize()

Implements org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getColumnSize.

Doc from org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getColumnSize.

The column size (length).

Returns:int

The column length

Annotations
@Override
getColumnSizeback to summary
public Size getColumnSize(Dialect dialect, Mapping mapping)

Deprecated

as a consequence of Mapping being deprecated. See corresponding docs for further information.

getCommentback to summary
public String getComment()
getCustomReadback to summary
public String getCustomRead()
getCustomReadExpressionback to summary
public String getCustomReadExpression()

Implements org.hibernate.mapping.Selectable.getCustomReadExpression.

Doc from org.hibernate.mapping.Selectable.getCustomReadExpression.

Any custom read expression for this selectable. Only pertinent for physical columns (not formulas)

Annotations
@Override
getCustomWriteback to summary
public String getCustomWrite()
getCustomWriteExpressionback to summary
public String getCustomWriteExpression()

Implements org.hibernate.mapping.Selectable.getCustomWriteExpression.

Doc from org.hibernate.mapping.Selectable.getCustomWriteExpression.

Any custom write expression for this selectable. Only pertinent for physical columns (not formulas)

Annotations
@Override
getDecimalDigitsback to summary
public int getDecimalDigits()

Implements org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getDecimalDigits.

Doc from org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getDecimalDigits.

The precision, for numeric types

Returns:int

The numeric precision

Annotations
@Override
getDefaultValueback to summary
public String getDefaultValue()
getGeneratedAsback to summary
public String getGeneratedAs()
getLengthback to summary
public Long getLength()
getNameback to summary
public String getName()
getNullableback to summary
public TruthValue getNullable()

Implements org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getNullable.

Doc from org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getNullable.

Is the column nullable. The database is allowed to report unknown, hence the use of TruthValue

Returns:TruthValue

nullability.

Annotations
@Override
getPrecisionback to summary
public Integer getPrecision()
getQuotedNameback to summary
public String getQuotedName()
Returns:String

the quoted name as it would occur in the mapping file

getQuotedNameback to summary
public String getQuotedName(Dialect dialect)
Returns:String

the quoted name using the quoting syntax of the given dialect

getReadExprback to summary
public String getReadExpr(Dialect dialect)
getScaleback to summary
public Integer getScale()
getSqlTypeback to summary
public String getSqlType(Metadata mapping)

Deprecated

as a consequence of Metadata being deprecated. See corresponding docs for further information.

getSqlTypeback to summary
public String getSqlType(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping)

Deprecated

since 6.2.

use getSqlType(Metadata)

Annotations
@Deprecated
since:6.2
getSqlTypeback to summary
public String getSqlType()
getSqlTypeCodeback to summary
public int getSqlTypeCode(Mapping mapping) throws MappingException

Deprecated

as a consequence of Mapping being deprecated. See corresponding docs for further information.

getSqlTypeCodeback to summary
public Integer getSqlTypeCode()

Returns SQL type code for this column, or null if the type code is unknown.

Use getSqlTypeCode(Mapping) to retrieve the type code using Value associated with the column.

Returns:Integer

the type code, if it is set, otherwise null.

getSqlTypeNameback to summary
private String getSqlTypeName(DdlTypeRegistry ddlTypeRegistry, Dialect dialect, Mapping mapping)

Deprecated

as a consequence of Mapping being deprecated. See corresponding docs for further information.

getTemplateback to summary
public String getTemplate(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry registry)

Implements org.hibernate.mapping.Selectable.getTemplate.

Annotations
@Override
getTextback to summary
public String getText(Dialect dialect)

Implements org.hibernate.mapping.Selectable.getText.

Doc from org.hibernate.mapping.Selectable.getText.

The selectable's text representation accounting for the Dialect's quoting, if quoted

Annotations
@Override
getTextback to summary
public String getText()

Implements org.hibernate.mapping.Selectable.getText.

Doc from org.hibernate.mapping.Selectable.getText.

The selectable's "canonical" text representation

Annotations
@Override
getTypeCodeback to summary
public int getTypeCode()

Implements org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getTypeCode.

Doc from org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getTypeCode.

The JDBC type-code.

Returns:int

JDBC type-code

Annotations
@Override
getTypeForComponentValueback to summary
private Type getTypeForComponentValue(Mapping mapping, Type type, int typeIndex)

Deprecated

as a consequence of Mapping being deprecated. See corresponding docs for further information.

getTypeForEntityValueback to summary
private Type getTypeForEntityValue(Mapping mapping, Type type, int typeIndex)

Deprecated

as a consequence of Mapping being deprecated. See corresponding docs for further information.

getTypeIndexback to summary
public int getTypeIndex()
getTypeNameback to summary
public String getTypeName()

Implements org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getTypeName.

Doc from org.hibernate.tool.schema.extract.spi.ColumnTypeInformation.getTypeName.

The database specific type name.

Returns:String

Type name

Annotations
@Override
getUnderlyingTypeback to summary
private static Type getUnderlyingType(Mapping mapping, Type type, int typeIndex)

Deprecated

as a consequence of Mapping being deprecated. See corresponding docs for further information.

getValueback to summary
public Value getValue()
getWriteExprback to summary
public String getWriteExpr()

Overrides default org.hibernate.mapping.Selectable.getWriteExpr.

Annotations
@Override
hasCheckConstraintback to summary
public boolean hasCheckConstraint()
hasCustomReadback to summary
public boolean hasCustomRead()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isCloseQuoteback to summary
private static boolean isCloseQuote(char ch)
isExplicitback to summary
public boolean isExplicit()
isFormulaback to summary
public boolean isFormula()

Implements org.hibernate.mapping.Selectable.isFormula.

Doc from org.hibernate.mapping.Selectable.isFormula.

Does this selectable represent a formula? true indicates it is a formula; false indicates it is a physical column

Annotations
@Override
isNullableback to summary
public boolean isNullable()
isOpenQuoteback to summary
private static boolean isOpenQuote(char ch)
isQuotedback to summary
private static boolean isQuoted(String name)
isQuotedback to summary
public boolean isQuoted()
isSqlTypeLobback to summary
public boolean isSqlTypeLob()
isSqlTypeLobback to summary
public boolean isSqlTypeLob(Metadata mapping)

Deprecated

as a consequence of Metadata being deprecated. See corresponding docs for further information.

isUniqueback to summary
public boolean isUnique()
setArrayLengthback to summary
public void setArrayLength(Integer arrayLength)
setAssignmentExpressionback to summary
public void setAssignmentExpression(String assignmentExpression)
setCheckConstraintback to summary
public void setCheckConstraint(String constraint)

Deprecated

since 6.2.

Annotations
@Deprecated
since:6.2
setCollationback to summary
public void setCollation(String collation)
setCommentback to summary
public void setComment(String comment)
setCustomReadback to summary
public void setCustomRead(String customRead)
setCustomWriteback to summary
public void setCustomWrite(String customWrite)
setDefaultValueback to summary
public void setDefaultValue(String defaultValue)
setExplicitback to summary
public void setExplicit(boolean explicit)
setGeneratedAsback to summary
public void setGeneratedAs(String generatedAs)
setLengthback to summary
public void setLength(Long length)
setLengthback to summary
public void setLength(Integer length)
setNameback to summary
public void setName(String name)
setNullableback to summary
public void setNullable(boolean nullable)
setPrecisionback to summary
public void setPrecision(Integer precision)
setResolvedCustomReadback to summary
public void setResolvedCustomRead(String customRead)
setScaleback to summary
public void setScale(Integer scale)
setSqlTypeback to summary
public void setSqlType(String typeName)
setSqlTypeCodeback to summary
public void setSqlTypeCode(Integer typeCode)
setTypeIndexback to summary
public void setTypeIndex(int typeIndex)
setUniqueback to summary
public void setUnique(boolean unique)
setValueback to summary
public void setValue(Value value)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override