Package org.hibernate.mapping
Class Column
java.lang.Object
org.hibernate.mapping.Column
- All Implemented Interfaces:
Serializable,Cloneable,Selectable
A column of a relational database table
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intstatic final intstatic final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Objectclone()Shallow copy, the value is not copiedbooleanbooleanFor any column name, generate an alias that is unique to that column name, and also 10 characters or less in length.Generate a column alias that is unique across multiple tablesintgetName()intreturns quoted name as it would be in the mapping file.getReadExpr(Dialect dialect) intgetScale()getSqlType(Dialect dialect, Mapping mapping) Returns the underlying columns sqltypecode.intgetSqlTypeCode(Mapping mapping) getTemplate(Dialect dialect, SQLFunctionRegistry functionRegistry) getText()intgetValue()booleanbooleaninthashCode()booleanbooleanbooleanisQuoted()booleanisUnique()voidsetCheckConstraint(String checkConstraint) voidsetComment(String comment) voidsetCustomRead(String customRead) voidsetCustomWrite(String customWrite) voidsetDefaultValue(String defaultValue) voidsetLength(int length) voidvoidsetNullable(boolean nullable) voidsetPrecision(int scale) voidsetScale(int scale) voidsetSqlType(String sqlType) voidsetSqlTypeCode(Integer typecode) voidsetTypeIndex(int typeIndex) voidsetUnique(boolean unique) voidtoString()
-
Field Details
-
DEFAULT_LENGTH
public static final int DEFAULT_LENGTH- See Also:
-
DEFAULT_PRECISION
public static final int DEFAULT_PRECISION- See Also:
-
DEFAULT_SCALE
public static final int DEFAULT_SCALE- See Also:
-
-
Constructor Details
-
Column
public Column() -
Column
-
-
Method Details
-
getLength
public int getLength() -
setLength
public void setLength(int length) -
getValue
-
setValue
-
getName
-
setName
-
getQuotedName
returns quoted name as it would be in the mapping file. -
getQuotedName
-
getAlias
For any column name, generate an alias that is unique to that column name, and also 10 characters or less in length.- 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) -
getSqlTypeCode
- Throws:
MappingException
-
getSqlTypeCode
Returns the underlying columns sqltypecode. If null, it is because the sqltype code is unknown. Use #getSqlTypeCode(Mapping) to retreive the sqltypecode used for the columns associated Value/Type.- Returns:
- sqltypecode if it is set, otherwise null.
-
setSqlTypeCode
-
isUnique
public boolean isUnique() -
getSqlType
- Throws:
HibernateException
-
equals
-
equals
-
hashCode
public int hashCode() -
getSqlType
-
setSqlType
-
setUnique
public void setUnique(boolean unique) -
isQuoted
public boolean isQuoted() -
toString
-
getCheckConstraint
-
setCheckConstraint
-
hasCheckConstraint
public boolean hasCheckConstraint() -
getTemplate
- Specified by:
getTemplatein interfaceSelectable
-
hasCustomRead
public boolean hasCustomRead() -
getReadExpr
-
getWriteExpr
-
isFormula
public boolean isFormula()- Specified by:
isFormulain interfaceSelectable
-
getText
- Specified by:
getTextin interfaceSelectable
-
getText
- Specified by:
getTextin interfaceSelectable
-
getPrecision
public int getPrecision() -
setPrecision
public void setPrecision(int scale) -
getScale
public int getScale() -
setScale
public void setScale(int scale) -
getComment
-
setComment
-
getDefaultValue
-
setDefaultValue
-
getCustomWrite
-
setCustomWrite
-
getCustomRead
-
setCustomRead
-
getCanonicalName
-
clone
Shallow copy, the value is not copied
-