Top Description Fields Constructors Methods
org.hibernate.mapping

public Class Column

extends Object
implements Selectable, Serializable, Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable, java.io.Serializable, org.hibernate.mapping.Selectable
Known Direct Subclasses
org.hibernate.id.ExportableColumn
Imports
java.io.Serializable, java.util.Locale, org.hibernate.HibernateException, .MappingException, org.hibernate.dialect.Dialect, org.hibernate.dialect.function.SQLFunctionRegistry, org.hibernate.engine.spi.Mapping, org.hibernate.internal.util.StringHelper, org.hibernate.loader.internal.AliasConstantsHelper, org.hibernate.sql.Template

A column of a relational database table
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private String
private String
private String
private String
public static final int
public static final int
public static final int
private String
private int
private String
private boolean
private int
private boolean
private int
private String
private Integer
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 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.

Deprecated as a consequence of Table being deprecated.
Generate a column alias that is unique across multiple tables
public String
public String
public String
public String
public String
public String
public int
public String
public int
public String
getQuotedName()

returns quoted name as it would be in the mapping file.

public String
public String
public int
public String
getSqlType(Dialect dialect, Mapping mapping)

public String
public int
public Integer

Returns:

sqlTypeCode if it is set, otherwise null.
getSqlTypeCode
()

Returns the underlying columns SqlTypeCode.

public String
public String
public String
public int
public Value
public String
public boolean
public boolean
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
public boolean
public boolean
public boolean
public void
setCheckConstraint(String checkConstraint)

public void
setComment(String comment)

public void
setCustomRead(String customRead)

public void
setCustomWrite(String customWrite)

public void
setDefaultValue(String defaultValue)

public void
setLength(int length)

public void
public void
setNullable(boolean nullable)

public void
setPrecision(int scale)

public void
setScale(int scale)

public void
setSqlType(String sqlType)

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

checkConstraintback to summary
private String checkConstraint
commentback to summary
private String comment
customReadback to summary
private String customRead
customWriteback to summary
private String customWrite
DEFAULT_LENGTHback to summary
public static final int DEFAULT_LENGTH
DEFAULT_PRECISIONback to summary
public static final int DEFAULT_PRECISION
DEFAULT_SCALEback to summary
public static final int DEFAULT_SCALE
defaultValueback to summary
private String defaultValue
lengthback to summary
private int length
nameback to summary
private String name
nullableback to summary
private boolean nullable
precisionback to summary
private int precision
quotedback to summary
private boolean quoted
scaleback to summary
private int scale
sqlTypeback to summary
private String sqlType
sqlTypeCodeback to summary
private Integer sqlTypeCode
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

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)
Annotations
@SuppressWarnings:SimplifiableIfStatement
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.

Deprecated

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

Generate a column alias that is unique across multiple tables

Annotations
@Override
getCanonicalNameback to summary
public String getCanonicalName()
getCheckConstraintback to summary
public String getCheckConstraint()
getCommentback to summary
public String getComment()
getCustomReadback to summary
public String getCustomRead()
getCustomWriteback to summary
public String getCustomWrite()
getDefaultValueback to summary
public String getDefaultValue()
getLengthback to summary
public int getLength()
getNameback to summary
public String getName()
getPrecisionback to summary
public int getPrecision()
getQuotedNameback to summary
public String getQuotedName()

returns quoted name as it would be in the mapping file.

getQuotedNameback to summary
public String getQuotedName(Dialect d)
getReadExprback to summary
public String getReadExpr(Dialect dialect)
getScaleback to summary
public int getScale()
getSqlTypeback to summary
public String getSqlType(Dialect dialect, Mapping mapping) throws HibernateException
getSqlTypeback to summary
public String getSqlType()
getSqlTypeCodeback to summary
public int getSqlTypeCode(Mapping mapping) throws MappingException
getSqlTypeCodeback to summary
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:Integer

sqlTypeCode if it is set, otherwise null.

getTemplateback to summary
public String getTemplate(Dialect dialect, SQLFunctionRegistry functionRegistry)

Implements org.hibernate.mapping.Selectable.getTemplate.

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

Implements org.hibernate.mapping.Selectable.getText.

Annotations
@Override
getTextback to summary
public String getText()

Implements org.hibernate.mapping.Selectable.getText.

Annotations
@Override
getTypeIndexback to summary
public int getTypeIndex()
getValueback to summary
public Value getValue()
getWriteExprback to summary
public String getWriteExpr()
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
isFormulaback to summary
public boolean isFormula()

Implements org.hibernate.mapping.Selectable.isFormula.

Annotations
@Override
isNullableback to summary
public boolean isNullable()
isQuotedback to summary
public boolean isQuoted()
isUniqueback to summary
public boolean isUnique()
setCheckConstraintback to summary
public void setCheckConstraint(String checkConstraint)
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)
setLengthback to summary
public void setLength(int length)
setNameback to summary
public void setName(String name)
setNullableback to summary
public void setNullable(boolean nullable)
setPrecisionback to summary
public void setPrecision(int scale)
setScaleback to summary
public void setScale(int scale)
setSqlTypeback to summary
public void setSqlType(String sqlType)
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