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-definedColumns
annotation) and so JPA lets eachColumn
specify 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 void
addColumn(AnnotatedColumn child)
void
checkPropertyConsistency()
MetadataBuildingContext
getBuildingContext()
List<AnnotatedColumn>
getColumns()
Join
getJoin()
PropertyHolder
getPropertyHolder()
String
getPropertyName()
A property path relative to thePropertyHolder
.Table
getTable()
Find the table to which these columns belong, taking into account secondary tables.boolean
isSecondary()
void
setBuildingContext(MetadataBuildingContext buildingContext)
void
setJoins(Map<String,Join> joins)
void
setPropertyHolder(PropertyHolder propertyHolder)
void
setPropertyName(String propertyName)
void
setTable(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
Table
given in the code byColumn.table()
and held here byexplicitTableName
. - Throws:
AnnotationException
- if the table named byexplicitTableName
is not found among the secondary tables injoins
.
-
setTable
public void setTable(Table table)
-
addColumn
public void addColumn(AnnotatedColumn child)
-
checkPropertyConsistency
public void checkPropertyConsistency()
-
-