Class AnnotatedJoinColumns
- java.lang.Object
-
- org.hibernate.boot.model.internal.AnnotatedColumns
-
- org.hibernate.boot.model.internal.AnnotatedJoinColumns
-
public class AnnotatedJoinColumns extends AnnotatedColumns
A list ofJoinColumn
s that form a single join condition, similar in concept toJoinColumns
, but not every instance of this class corresponds to an explicit annotation in the Java code.There's no exact analog of this class in the mapping model, so some information is lost when it's transformed into a list of
Column
s.
-
-
Constructor Summary
Constructors Constructor Description AnnotatedJoinColumns()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addColumn(AnnotatedColumn child)
void
addColumn(AnnotatedJoinColumn child)
static AnnotatedJoinColumns
buildJoinColumns(jakarta.persistence.JoinColumn[] joinColumns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, PropertyData inferredData, MetadataBuildingContext buildingContext)
static AnnotatedJoinColumns
buildJoinColumnsOrFormulas(JoinColumnOrFormula[] joinColumnOrFormulas, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, PropertyData inferredData, MetadataBuildingContext context)
static AnnotatedJoinColumns
buildJoinColumnsWithDefaultColumnSuffix(jakarta.persistence.JoinColumn[] joinColumns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, PropertyData inferredData, String defaultColumnSuffix, MetadataBuildingContext context)
static AnnotatedJoinColumns
buildJoinTableJoinColumns(jakarta.persistence.JoinColumn[] joinColumns, Map<String,Join> secondaryTables, PropertyHolder propertyHolder, PropertyData inferredData, String mappedBy, MetadataBuildingContext context)
Called for join tables inManyToMany
associations.List<AnnotatedJoinColumn>
getJoinColumns()
String
getManyToManyOwnerSideEntityName()
String
getMappedBy()
String
getMappedByEntityName()
String
getMappedByPropertyName()
String
getMappedByTableName()
String
getPropertyName()
A property path relative to thePropertyHolder
.ForeignKeyType
getReferencedColumnsType(PersistentClass referencedEntity)
Determine if the givenAnnotatedJoinColumns
represent a reference to the primary key of the givenPersistentClass
, or whether they reference some other combination of mapped columns.boolean
hasMappedBy()
boolean
isElementCollection()
void
setElementCollection(boolean elementCollection)
void
setManyToManyOwnerSideEntityName(String entityName)
void
setMappedBy(String mappedBy)
void
setMappedBy(String entityName, String logicalTableName, String mappedByProperty)
void
setPropertyName(String propertyName)
-
Methods inherited from class org.hibernate.boot.model.internal.AnnotatedColumns
checkPropertyConsistency, getBuildingContext, getColumns, getJoin, getPropertyHolder, getTable, isSecondary, setBuildingContext, setJoins, setPropertyHolder, setTable
-
-
-
-
Method Detail
-
buildJoinColumnsOrFormulas
public static AnnotatedJoinColumns buildJoinColumnsOrFormulas(JoinColumnOrFormula[] joinColumnOrFormulas, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, PropertyData inferredData, MetadataBuildingContext context)
-
buildJoinColumns
public static AnnotatedJoinColumns buildJoinColumns(jakarta.persistence.JoinColumn[] joinColumns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, PropertyData inferredData, MetadataBuildingContext buildingContext)
-
buildJoinColumnsWithDefaultColumnSuffix
public static AnnotatedJoinColumns buildJoinColumnsWithDefaultColumnSuffix(jakarta.persistence.JoinColumn[] joinColumns, String mappedBy, Map<String,Join> joins, PropertyHolder propertyHolder, PropertyData inferredData, String defaultColumnSuffix, MetadataBuildingContext context)
-
buildJoinTableJoinColumns
public static AnnotatedJoinColumns buildJoinTableJoinColumns(jakarta.persistence.JoinColumn[] joinColumns, Map<String,Join> secondaryTables, PropertyHolder propertyHolder, PropertyData inferredData, String mappedBy, MetadataBuildingContext context)
Called for join tables inManyToMany
associations.
-
getJoinColumns
public List<AnnotatedJoinColumn> getJoinColumns()
-
addColumn
public void addColumn(AnnotatedColumn child)
- Overrides:
addColumn
in classAnnotatedColumns
-
addColumn
public void addColumn(AnnotatedJoinColumn child)
-
getMappedBy
public String getMappedBy()
-
setMappedBy
public void setMappedBy(String mappedBy)
-
hasMappedBy
public boolean hasMappedBy()
- Returns:
- true if the association mapping annotation did specify
mappedBy
, meaning that this@JoinColumn
mapping belongs to an unowned many-valued association.
-
getMappedByEntityName
public String getMappedByEntityName()
-
getMappedByPropertyName
public String getMappedByPropertyName()
-
getMappedByTableName
public String getMappedByTableName()
-
isElementCollection
public boolean isElementCollection()
-
setElementCollection
public void setElementCollection(boolean elementCollection)
-
setManyToManyOwnerSideEntityName
public void setManyToManyOwnerSideEntityName(String entityName)
-
getManyToManyOwnerSideEntityName
public String getManyToManyOwnerSideEntityName()
-
setMappedBy
public void setMappedBy(String entityName, String logicalTableName, String mappedByProperty)
-
getReferencedColumnsType
public ForeignKeyType getReferencedColumnsType(PersistentClass referencedEntity)
Determine if the givenAnnotatedJoinColumns
represent a reference to the primary key of the givenPersistentClass
, or whether they reference some other combination of mapped columns.
-
getPropertyName
public String getPropertyName()
A property path relative to thePropertyHolder
.- Overrides:
getPropertyName
in classAnnotatedColumns
-
setPropertyName
public void setPropertyName(String propertyName)
- Overrides:
setPropertyName
in classAnnotatedColumns
-
-