Package org.hibernate.cfg
Class AnnotatedJoinColumn
- java.lang.Object
-
- org.hibernate.cfg.AnnotatedColumn
-
- org.hibernate.cfg.AnnotatedJoinColumn
-
public class AnnotatedJoinColumn extends AnnotatedColumn
Wrap state of an EJB3 @JoinColumn annotation and build the Hibernate column mapping element
-
-
Field Summary
Fields Modifier and Type Field Description static intNO_REFERENCEstatic intNON_PK_REFERENCEstatic intPK_REFERENCE-
Fields inherited from class org.hibernate.cfg.AnnotatedColumn
joins, propertyHolder, sqlType
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidaddColumnBinding(SimpleValue value)voidaddDefaultJoinColumnName(PersistentClass referencedEntity, String logicalReferencedColumn)static AnnotatedJoinColumnbuildJoinColumn(PrimaryKeyJoinColumn pkJoinAnn, JoinColumn joinAnn, Value identifier, Map<String,Join> joins, PropertyHolder propertyHolder, MetadataBuildingContext context)Build JoinColumn for a JOINED hierarchystatic AnnotatedJoinColumn[]buildJoinColumns(JoinColumn[] anns, Comment comment, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, MetadataBuildingContext buildingContext)static AnnotatedJoinColumn[]buildJoinColumnsOrFormulas(JoinColumnOrFormula[] anns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, MetadataBuildingContext buildingContext)static AnnotatedJoinColumn[]buildJoinColumnsWithDefaultColumnSuffix(JoinColumn[] anns, Comment comment, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, String suffixForDefaultColumnName, MetadataBuildingContext buildingContext)static AnnotatedJoinColumnbuildJoinFormula(JoinFormula ann, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, MetadataBuildingContext buildingContext)build join formulastatic AnnotatedJoinColumn[]buildJoinTableJoinColumns(JoinColumn[] annJoins, Map<String,Join> secondaryTables, PropertyHolder propertyHolder, String propertyName, String mappedBy, MetadataBuildingContext buildingContext)static voidcheckIfJoinColumn(Object columns, PropertyHolder holder, PropertyData property)static intcheckReferencedColumnsType(AnnotatedJoinColumn[] columns, PersistentClass referencedEntity, MetadataBuildingContext context)voidcopyReferencedStructureAndCreateDefaultJoinColumns(PersistentClass referencedEntity, SimpleValue referencedValue, SimpleValue value)StringgetManyToManyOwnerSideEntityName()StringgetMappedBy()StringgetReferencedColumn()voidlinkValueUsingAColumnCopy(Column column, SimpleValue value)used for mappedBy casesvoidlinkValueUsingDefaultColumnNaming(Column referencedColumn, PersistentClass referencedEntity, SimpleValue value)voidoverrideFromReferencedColumnIfNecessary(Column column)Called to apply column definitions from the referenced FK column to this column.voidredefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy)voidsetJoinAnnotation(JoinColumn annJoin, String defaultName)voidsetJPA2ElementCollection(boolean JPA2ElementCollection)voidsetManyToManyOwnerSideEntityName(String manyToManyOwnerSideEntityName)voidsetMappedBy(String mappedBy)voidsetMappedBy(String entityName, String jpaEntityName, String logicalTableName, String mappedByProperty)voidsetPersistentClass(PersistentClass persistentClass, Map<String,Join> joins, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)Override persistent class on oneToMany Cases for late settings Must only be used on second level pass bindingvoidsetReferencedColumn(String referencedColumn)StringtoString()-
Methods inherited from class org.hibernate.cfg.AnnotatedColumn
addIndex, bind, buildColumnFromAnnotation, buildColumnFromAnnotation, checkPropertyConsistency, forceNotNull, getBuildingContext, getCheckConstraint, getComment, getDefaultValue, getExplicitTableName, getFormulaString, getGeneratedAs, getJoin, getLength, getLogicalColumnName, getMappingColumn, getName, getPrecision, getPropertyHolder, getPropertyName, getScale, getSqlType, getTable, initMappingColumn, isFormula, isImplicit, isInsertable, isNameDeferred, isNullable, isSecondary, isUnique, isUpdatable, linkWithValue, setBuildingContext, setCheckConstraint, setComment, setDefaultValue, setExplicitTableName, setFormula, setImplicit, setInsertable, setJoins, setLength, setLogicalColumnName, setMappingColumn, setNullable, setPrecision, setPropertyHolder, setPropertyName, setScale, setSqlType, setTable, setUnique, setUpdatable
-
-
-
-
Field Detail
-
NO_REFERENCE
public static final int NO_REFERENCE
- See Also:
- Constant Field Values
-
PK_REFERENCE
public static final int PK_REFERENCE
- See Also:
- Constant Field Values
-
NON_PK_REFERENCE
public static final int NON_PK_REFERENCE
- See Also:
- Constant Field Values
-
-
Method Detail
-
setJPA2ElementCollection
public void setJPA2ElementCollection(boolean JPA2ElementCollection)
-
getManyToManyOwnerSideEntityName
public String getManyToManyOwnerSideEntityName()
-
setManyToManyOwnerSideEntityName
public void setManyToManyOwnerSideEntityName(String manyToManyOwnerSideEntityName)
-
setReferencedColumn
public void setReferencedColumn(String referencedColumn)
-
getMappedBy
public String getMappedBy()
-
setMappedBy
public void setMappedBy(String mappedBy)
-
getReferencedColumn
public String getReferencedColumn()
-
buildJoinColumnsOrFormulas
public static AnnotatedJoinColumn[] buildJoinColumnsOrFormulas(JoinColumnOrFormula[] anns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, MetadataBuildingContext buildingContext)
-
buildJoinFormula
public static AnnotatedJoinColumn buildJoinFormula(JoinFormula ann, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, MetadataBuildingContext buildingContext)
build join formula
-
buildJoinColumns
public static AnnotatedJoinColumn[] buildJoinColumns(JoinColumn[] anns, Comment comment, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, MetadataBuildingContext buildingContext)
-
buildJoinColumnsWithDefaultColumnSuffix
public static AnnotatedJoinColumn[] buildJoinColumnsWithDefaultColumnSuffix(JoinColumn[] anns, Comment comment, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, String propertyName, String suffixForDefaultColumnName, MetadataBuildingContext buildingContext)
-
setJoinAnnotation
public void setJoinAnnotation(JoinColumn annJoin, String defaultName)
-
buildJoinColumn
public static AnnotatedJoinColumn buildJoinColumn(PrimaryKeyJoinColumn pkJoinAnn, JoinColumn joinAnn, Value identifier, Map<String,Join> joins, PropertyHolder propertyHolder, MetadataBuildingContext context)
Build JoinColumn for a JOINED hierarchy
-
setPersistentClass
public void setPersistentClass(PersistentClass persistentClass, Map<String,Join> joins, Map<org.hibernate.annotations.common.reflection.XClass,InheritanceState> inheritanceStatePerClass)
Override persistent class on oneToMany Cases for late settings Must only be used on second level pass binding
-
checkIfJoinColumn
public static void checkIfJoinColumn(Object columns, PropertyHolder holder, PropertyData property)
-
copyReferencedStructureAndCreateDefaultJoinColumns
public void copyReferencedStructureAndCreateDefaultJoinColumns(PersistentClass referencedEntity, SimpleValue referencedValue, SimpleValue value)
-
linkValueUsingDefaultColumnNaming
public void linkValueUsingDefaultColumnNaming(Column referencedColumn, PersistentClass referencedEntity, SimpleValue value)
-
addDefaultJoinColumnName
public void addDefaultJoinColumnName(PersistentClass referencedEntity, String logicalReferencedColumn)
-
linkValueUsingAColumnCopy
public void linkValueUsingAColumnCopy(Column column, SimpleValue value)
used for mappedBy cases
-
addColumnBinding
protected void addColumnBinding(SimpleValue value)
- Overrides:
addColumnBindingin classAnnotatedColumn
-
checkReferencedColumnsType
public static int checkReferencedColumnsType(AnnotatedJoinColumn[] columns, PersistentClass referencedEntity, MetadataBuildingContext context)
-
overrideFromReferencedColumnIfNecessary
public void overrideFromReferencedColumnIfNecessary(Column column)
Called to apply column definitions from the referenced FK column to this column.- Parameters:
column- the referenced column.
-
redefineColumnName
public void redefineColumnName(String columnName, String propertyName, boolean applyNamingStrategy)
- Overrides:
redefineColumnNamein classAnnotatedColumn
-
buildJoinTableJoinColumns
public static AnnotatedJoinColumn[] buildJoinTableJoinColumns(JoinColumn[] annJoins, Map<String,Join> secondaryTables, PropertyHolder propertyHolder, String propertyName, String mappedBy, MetadataBuildingContext buildingContext)
-
setMappedBy
public void setMappedBy(String entityName, String jpaEntityName, String logicalTableName, String mappedByProperty)
-
toString
public String toString()
- Overrides:
toStringin classAnnotatedColumn
-
-