Class AnnotatedColumns
- java.lang.Object
-
- org.hibernate.boot.model.internal.AnnotatedColumns
-
- Direct Known Subclasses:
AnnotatedJoinColumns
public class AnnotatedColumns extends Object
A list of columns that are mapped to a single Java property or field. This is a slightly uncomfortable abstraction here, because this concept is arguably missing from JPA (where there's no equivalent of the Hibernate-definedColumnsannotation) and so JPA lets eachColumnspecify its owntable. That leaves us having to enforce the requirement that every column mapped to a given property must belong to the same table.
-
-
Constructor Summary
Constructors Constructor Description AnnotatedColumns()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddColumn(AnnotatedColumn child)voidcheckPropertyConsistency()MetadataBuildingContextgetBuildingContext()List<AnnotatedColumn>getColumns()JoingetJoin()PropertyHoldergetPropertyHolder()StringgetPropertyName()A property path relative to thePropertyHolder.TablegetTable()Find the table to which these columns belong, taking into account secondary tables.booleanisSecondary()voidsetBuildingContext(MetadataBuildingContext buildingContext)voidsetJoins(Map<String,Join> joins)voidsetPropertyHolder(PropertyHolder propertyHolder)voidsetPropertyName(String propertyName)voidsetTable(Table table)
-
-
-
Method Detail
-
getColumns
public List<AnnotatedColumn> getColumns()
-
getPropertyHolder
public PropertyHolder getPropertyHolder()
-
setPropertyHolder
public void setPropertyHolder(PropertyHolder propertyHolder)
-
getPropertyName
public String getPropertyName()
A property path relative to thePropertyHolder.
-
setPropertyName
public void setPropertyName(String propertyName)
-
setBuildingContext
public void setBuildingContext(MetadataBuildingContext buildingContext)
-
getBuildingContext
public MetadataBuildingContext getBuildingContext()
-
getJoin
public Join getJoin()
-
isSecondary
public boolean isSecondary()
-
getTable
public Table getTable()
Find the table to which these columns belong, taking into account secondary tables.- Returns:
- the
Tablegiven in the code byColumn.table()and held here byexplicitTableName. - Throws:
AnnotationException- if the table named byexplicitTableNameis not found among the secondary tables injoins.
-
setTable
public void setTable(Table table)
-
addColumn
public void addColumn(AnnotatedColumn child)
-
checkPropertyConsistency
public void checkPropertyConsistency()
-
-