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:
-
Field Summary
Fields inherited from interface org.hibernate.tool.schema.extract.spi.ColumnTypeInformation
EMPTY
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addCheckConstraint
(CheckConstraint checkConstraint) Deprecated.clone()
Shallow copy, the value is not copiedboolean
boolean
Generate a column alias that is unique across multiple tablesDeprecated.int
The column size (length).getColumnSize
(Dialect dialect, Mapping mapping) Any custom read expression for this selectable.Any custom write expression for this selectable.int
The precision, for numeric typesgetName()
getNameIdentifier
(MetadataBuildingContext buildingContext) Is the column nullable.getQuotedName
(Dialect dialect) getReadExpr
(Dialect dialect) getScale()
getSqlType
(Metadata mapping) getSqlType
(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping) Deprecated.Returns SQL type code for this column, ornull
if the type code is unknown.int
getSqlTypeCode
(Mapping mapping) getTemplate
(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry registry) getText()
The selectable's "canonical" text representationThe selectable's text representation accounting for the Dialect's quoting, if quotedint
The JDBC type-code.int
The database specific type name.getValue()
boolean
boolean
int
hashCode()
boolean
boolean
Does this selectable represent a formula?true
indicates it is a formula;false
indicates it is a physical columnboolean
boolean
boolean
isQuoted()
boolean
boolean
isSqlTypeLob
(Metadata mapping) boolean
isUnique()
void
setArrayLength
(Integer arrayLength) void
setAssignmentExpression
(String assignmentExpression) void
setCheckConstraint
(String constraint) Deprecated.void
setCollation
(String collation) void
setComment
(String comment) void
setCustomRead
(String customRead) void
setCustomWrite
(String customWrite) void
setDefaultValue
(String defaultValue) void
setExplicit
(boolean explicit) void
setGeneratedAs
(String generatedAs) void
setIdentity
(boolean identity) void
void
void
void
setNullable
(boolean nullable) void
setPrecision
(Integer precision) void
setResolvedCustomRead
(String customRead) void
void
setSqlType
(String typeName) void
setSqlTypeCode
(Integer typeCode) void
setTemporalPrecision
(Integer temporalPrecision) void
setTypeIndex
(int typeIndex) void
setUnique
(boolean unique) void
setUniqueKeyName
(String keyName) void
toString()
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.hibernate.mapping.Selectable
getWriteExpr
-
Constructor Details
-
Column
public Column() -
Column
-
-
Method Details
-
getLength
-
setLength
-
setLength
-
getArrayLength
-
setArrayLength
-
getValue
-
setValue
-
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:
getAlias
in interfaceSelectable
-
getAlias
Generate a column alias that is unique across multiple tables- Specified by:
getAlias
in 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, ornull
if the type code is unknown.Use
getSqlTypeCode(Mapping)
to retrieve the type code usingValue
associated with the column.- Returns:
- the type code, if it is set, otherwise null.
-
setSqlTypeCode
-
getSqlType
-
getSqlType
@Deprecated(since="6.2") public String getSqlType(TypeConfiguration typeConfiguration, Dialect dialect, Mapping mapping) Deprecated. -
getTypeName
Description copied from interface:ColumnTypeInformation
The database specific type name.- Specified by:
getTypeName
in interfaceColumnTypeInformation
- Returns:
- Type name
-
getNullable
Description copied from interface:ColumnTypeInformation
Is the column nullable. The database is allowed to report unknown, hence the use of TruthValue- Specified by:
getNullable
in interfaceColumnTypeInformation
- Returns:
- nullability.
-
getTypeCode
public int getTypeCode()Description copied from interface:ColumnTypeInformation
The JDBC type-code.- Specified by:
getTypeCode
in interfaceColumnTypeInformation
- Returns:
- JDBC type-code
-
getColumnSize
public int getColumnSize()Description copied from interface:ColumnTypeInformation
The column size (length).- Specified by:
getColumnSize
in interfaceColumnTypeInformation
- Returns:
- The column length
-
getDecimalDigits
public int getDecimalDigits()Description copied from interface:ColumnTypeInformation
The precision, for numeric types- Specified by:
getDecimalDigits
in 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
-
getCheckConstraint
Deprecated. -
setCheckConstraint
Deprecated. -
hasCheckConstraint
public boolean hasCheckConstraint() -
checkConstraint
Deprecated. -
getTemplate
public String getTemplate(Dialect dialect, TypeConfiguration typeConfiguration, SqmFunctionRegistry registry) - Specified by:
getTemplate
in interfaceSelectable
-
hasCustomRead
public boolean hasCustomRead() -
getReadExpr
-
getWriteExpr
- Specified by:
getWriteExpr
in interfaceSelectable
-
isFormula
public boolean isFormula()Description copied from interface:Selectable
Does this selectable represent a formula?true
indicates it is a formula;false
indicates it is a physical column- Specified by:
isFormula
in interfaceSelectable
-
getText
Description copied from interface:Selectable
The selectable's text representation accounting for the Dialect's quoting, if quoted- Specified by:
getText
in interfaceSelectable
-
getText
Description copied from interface:Selectable
The selectable's "canonical" text representation- Specified by:
getText
in interfaceSelectable
-
getCustomReadExpression
Description copied from interface:Selectable
Any custom read expression for this selectable. Only pertinent for physical columns (not formulas)- Specified by:
getCustomReadExpression
in interfaceSelectable
- See Also:
-
getCustomWriteExpression
Description copied from interface:Selectable
Any custom write expression for this selectable. Only pertinent for physical columns (not formulas)- Specified by:
getCustomWriteExpression
in 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
-
clone
Shallow copy, the value is not copied
-
getSqlType(Metadata)