Package org.hibernate.cfg
Class Ejb3Column
- java.lang.Object
-
- org.hibernate.cfg.Ejb3Column
-
- Direct Known Subclasses:
Ejb3DiscriminatorColumn,Ejb3JoinColumn,IndexColumn
public class Ejb3Column extends java.lang.ObjectWrap state of an EJB3 @Column annotation and build the Hibernate column mapping element
-
-
Field Summary
Fields Modifier and Type Field Description static intDEFAULT_COLUMN_LENGTHprotected java.util.Map<java.lang.String,Join>joinsprotected PropertyHolderpropertyHolderjava.lang.StringsqlType
-
Constructor Summary
Constructors Constructor Description Ejb3Column()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddColumnBinding(SimpleValue value)voidaddIndex(Index index, boolean inSecondPass)voidbind()static Ejb3Column[]buildColumnFromAnnotation(Column[] anns, Formula formulaAnn, Comment commentAnn, Nullability nullability, PropertyHolder propertyHolder, PropertyData inferredData, java.lang.String suffixForDefaultColumnName, java.util.Map<java.lang.String,Join> secondaryTables, MetadataBuildingContext context)static Ejb3Column[]buildColumnFromAnnotation(Column[] anns, Formula formulaAnn, Comment commentAnn, Nullability nullability, PropertyHolder propertyHolder, PropertyData inferredData, java.util.Map<java.lang.String,Join> secondaryTables, MetadataBuildingContext context)static voidcheckPropertyConsistency(Ejb3Column[] columns, java.lang.String propertyName)voidforceNotNull()protected MetadataBuildingContextgetBuildingContext()java.lang.StringgetComment()java.lang.StringgetDefaultValue()java.lang.StringgetExplicitTableName()java.lang.StringgetFormulaString()JoingetJoin()intgetLength()java.lang.StringgetLogicalColumnName()ColumngetMappingColumn()java.lang.StringgetName()intgetPrecision()PropertyHoldergetPropertyHolder()java.lang.StringgetPropertyName()intgetScale()java.lang.StringgetSqlType()TablegetTable()Find appropriate table of the column.protected voidinitMappingColumn(java.lang.String columnName, java.lang.String propertyName, int length, int precision, int scale, boolean nullable, java.lang.String sqlType, boolean unique, boolean applyNamingStrategy)booleanisFormula()booleanisImplicit()booleanisInsertable()booleanisNameDeferred()booleanisNullable()booleanisSecondary()booleanisUnique()booleanisUpdatable()voidlinkWithValue(SimpleValue value)voidredefineColumnName(java.lang.String columnName, java.lang.String propertyName, boolean applyNamingStrategy)voidsetBuildingContext(MetadataBuildingContext context)voidsetComment(java.lang.String comment)voidsetDefaultValue(java.lang.String defaultValue)voidsetExplicitTableName(java.lang.String explicitTableName)voidsetFormula(java.lang.String formula)voidsetImplicit(boolean implicit)voidsetInsertable(boolean insertable)voidsetJoins(java.util.Map<java.lang.String,Join> joins)voidsetLength(int length)voidsetLogicalColumnName(java.lang.String logicalColumnName)protected voidsetMappingColumn(Column mappingColumn)voidsetNullable(boolean nullable)voidsetPrecision(int precision)voidsetPropertyHolder(PropertyHolder propertyHolder)voidsetPropertyName(java.lang.String propertyName)voidsetScale(int scale)voidsetSqlType(java.lang.String sqlType)voidsetTable(Table table)voidsetUnique(boolean unique)voidsetUpdatable(boolean updatable)java.lang.StringtoString()
-
-
-
Field Detail
-
joins
protected java.util.Map<java.lang.String,Join> joins
-
propertyHolder
protected PropertyHolder propertyHolder
-
DEFAULT_COLUMN_LENGTH
public static final int DEFAULT_COLUMN_LENGTH
- See Also:
- Constant Field Values
-
sqlType
public java.lang.String sqlType
-
-
Method Detail
-
setTable
public void setTable(Table table)
-
getLogicalColumnName
public java.lang.String getLogicalColumnName()
-
getSqlType
public java.lang.String getSqlType()
-
getLength
public int getLength()
-
getPrecision
public int getPrecision()
-
getScale
public int getScale()
-
isUnique
public boolean isUnique()
-
isFormula
public boolean isFormula()
-
getFormulaString
public java.lang.String getFormulaString()
-
getExplicitTableName
public java.lang.String getExplicitTableName()
-
setExplicitTableName
public void setExplicitTableName(java.lang.String explicitTableName)
-
setFormula
public void setFormula(java.lang.String formula)
-
isImplicit
public boolean isImplicit()
-
setInsertable
public void setInsertable(boolean insertable)
-
setUpdatable
public void setUpdatable(boolean updatable)
-
getBuildingContext
protected MetadataBuildingContext getBuildingContext()
-
setBuildingContext
public void setBuildingContext(MetadataBuildingContext context)
-
setImplicit
public void setImplicit(boolean implicit)
-
setSqlType
public void setSqlType(java.lang.String sqlType)
-
setLength
public void setLength(int length)
-
setPrecision
public void setPrecision(int precision)
-
setScale
public void setScale(int scale)
-
setLogicalColumnName
public void setLogicalColumnName(java.lang.String logicalColumnName)
-
setPropertyName
public void setPropertyName(java.lang.String propertyName)
-
getPropertyName
public java.lang.String getPropertyName()
-
setUnique
public void setUnique(boolean unique)
-
isNullable
public boolean isNullable()
-
getDefaultValue
public java.lang.String getDefaultValue()
-
setDefaultValue
public void setDefaultValue(java.lang.String defaultValue)
-
getComment
public java.lang.String getComment()
-
setComment
public void setComment(java.lang.String comment)
-
bind
public void bind()
-
initMappingColumn
protected void initMappingColumn(java.lang.String columnName, java.lang.String propertyName, int length, int precision, int scale, boolean nullable, java.lang.String sqlType, boolean unique, boolean applyNamingStrategy)
-
isNameDeferred
public boolean isNameDeferred()
-
redefineColumnName
public void redefineColumnName(java.lang.String columnName, java.lang.String propertyName, boolean applyNamingStrategy)
-
getName
public java.lang.String getName()
-
getMappingColumn
public Column getMappingColumn()
-
isInsertable
public boolean isInsertable()
-
isUpdatable
public boolean isUpdatable()
-
setNullable
public void setNullable(boolean nullable)
-
setJoins
public void setJoins(java.util.Map<java.lang.String,Join> joins)
-
getPropertyHolder
public PropertyHolder getPropertyHolder()
-
setPropertyHolder
public void setPropertyHolder(PropertyHolder propertyHolder)
-
setMappingColumn
protected void setMappingColumn(Column mappingColumn)
-
linkWithValue
public void linkWithValue(SimpleValue value)
-
addColumnBinding
protected void addColumnBinding(SimpleValue value)
-
getTable
public Table getTable()
Find appropriate table of the column. It can come from a secondary table or from the main table of the persistent class- Returns:
- appropriate table
- Throws:
AnnotationException- missing secondary table
-
isSecondary
public boolean isSecondary()
-
getJoin
public Join getJoin()
-
forceNotNull
public void forceNotNull()
-
buildColumnFromAnnotation
public static Ejb3Column[] buildColumnFromAnnotation(Column[] anns, Formula formulaAnn, Comment commentAnn, Nullability nullability, PropertyHolder propertyHolder, PropertyData inferredData, java.util.Map<java.lang.String,Join> secondaryTables, MetadataBuildingContext context)
-
buildColumnFromAnnotation
public static Ejb3Column[] buildColumnFromAnnotation(Column[] anns, Formula formulaAnn, Comment commentAnn, Nullability nullability, PropertyHolder propertyHolder, PropertyData inferredData, java.lang.String suffixForDefaultColumnName, java.util.Map<java.lang.String,Join> secondaryTables, MetadataBuildingContext context)
-
checkPropertyConsistency
public static void checkPropertyConsistency(Ejb3Column[] columns, java.lang.String propertyName)
-
addIndex
public void addIndex(Index index, boolean inSecondPass)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-