Top Description Inners Fields Constructors Methods
org.hibernate.persister.entity.mutation

public Class EntityTableMapping

extends Object
implements TableMapping
Class Inheritance
All Implemented Interfaces
org.hibernate.sql.model.TableMapping, org.hibernate.metamodel.mapping.TableDetails
Imports
java.util.BitSet, .List, .Objects, java.util.function.Consumer, org.hibernate.engine.spi.SharedSessionContractImplementor, org.hibernate.internal.util.collections.ArrayHelper, org.hibernate.jdbc.Expectation, org.hibernate.metamodel.mapping.JdbcMapping, .ModelPart, .SelectableConsumer, .SelectableMapping, .SelectableMappings, .TableDetails, org.hibernate.sql.model.MutationType, .TableMapping

Descriptor for the mapping of a table relative to an entity
Author
Steve Ebersole

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static enum
public static class
public static class
public static interface

Field Summary

Modifier and TypeField and Description
private final int[]
private final TableMapping.MutationDetails
private final BitSet
private final TableMapping.MutationDetails
private final EntityTableMapping.KeyMapping
private final int
private final String
private final TableMapping.MutationDetails

Constructor Summary

AccessConstructor and Description
public
EntityTableMapping(String tableName, int relativePosition, EntityTableMapping.KeyMapping keyMapping, boolean isOptional, boolean isInverse, boolean isIdentifierTable, int[] attributeIndexes, Expectation insertExpectation, String insertCustomSql, boolean insertCallable, Expectation updateExpectation, String updateCustomSql, boolean updateCallable, boolean cascadeDeleteEnabled, Expectation deleteExpectation, String deleteCustomSql, boolean deleteCallable, boolean dynamicUpdate, boolean dynamicInsert)

Method Summary

Modifier and TypeMethod and Description
public boolean
containsAttributeColumns(int attributeIndex)

public boolean
equals(Object
the reference object with which to compare.
o
)

Overrides java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.
public int[]
public String
public TableMapping.MutationDetails
getDeleteDetails()

Implements org.hibernate.sql.model.TableMapping.getDeleteDetails.

Details for deleting from this table
public Expectation
public String
public TableMapping.MutationDetails
getInsertDetails()

Implements org.hibernate.sql.model.TableMapping.getInsertDetails.

Details for insertion into this table
public Expectation
public TableDetails.KeyDetails
getKeyDetails()

Implements org.hibernate.metamodel.mapping.TableDetails.getKeyDetails.

Details about the primary-key of this table
public EntityTableMapping.KeyMapping
public int
getRelativePosition()

Implements org.hibernate.sql.model.TableMapping.getRelativePosition.

The position of the table relative to others for the MutationTarget
public String
getTableName()

Implements org.hibernate.sql.model.TableMapping.getTableName.

The name of the mapped table
public String
public TableMapping.MutationDetails
getUpdateDetails()

Implements org.hibernate.sql.model.TableMapping.getUpdateDetails.

Details for updating this table
public Expectation
public boolean
public int
hashCode()

Overrides java.lang.Object.hashCode.

Returns a hash code value for the object.
public boolean
isCascadeDeleteEnabled()

Implements org.hibernate.sql.model.TableMapping.isCascadeDeleteEnabled.

Whether deletions are cascaded to this table at the database level.
public boolean
public boolean
isIdentifierTable()

Implements org.hibernate.sql.model.TableMapping.isIdentifierTable.

Whether this table holds the identifier for the MutationTarget
public boolean
public boolean
isInverse()

Implements org.hibernate.sql.model.TableMapping.isInverse.

Whether the table is mapped as inverse
public boolean
isOptional()

Implements org.hibernate.sql.model.TableMapping.isOptional.

Whether the table is mapped as optional
public boolean
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.
Inherited from java.lang.Object:
clonefinalizegetClassnotifynotifyAllwaitwaitwait

Field Detail

attributeIndexesback to summary
private final int[] attributeIndexes
deleteDetailsback to summary
private final TableMapping.MutationDetails deleteDetails
flagsback to summary
private final BitSet flags
insertDetailsback to summary
private final TableMapping.MutationDetails insertDetails
keyMappingback to summary
private final EntityTableMapping.KeyMapping keyMapping
relativePositionback to summary
private final int relativePosition
tableNameback to summary
private final String tableName
updateDetailsback to summary
private final TableMapping.MutationDetails updateDetails

Constructor Detail

EntityTableMappingback to summary
public EntityTableMapping(String tableName, int relativePosition, EntityTableMapping.KeyMapping keyMapping, boolean isOptional, boolean isInverse, boolean isIdentifierTable, int[] attributeIndexes, Expectation insertExpectation, String insertCustomSql, boolean insertCallable, Expectation updateExpectation, String updateCustomSql, boolean updateCallable, boolean cascadeDeleteEnabled, Expectation deleteExpectation, String deleteCustomSql, boolean deleteCallable, boolean dynamicUpdate, boolean dynamicInsert)

Method Detail

containsAttributeColumnsback to summary
public boolean containsAttributeColumns(int attributeIndex)
equalsback to summary
public boolean equals(Object o)

Overrides java.lang.Object.equals.

Doc from java.lang.Object.equals.

Indicates whether some other object is "equal to" this one.

The equals method implements an equivalence relation on non-null object references:

  • It is reflexive: for any non-null reference value x, x.equals(x) should return true.
  • It is symmetric: for any non-null reference values x and y, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any non-null reference values x, y, and z, if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.
  • It is consistent: for any non-null reference values x and y, multiple invocations of x.equals(y) consistently return true or consistently return false, provided no information used in equals comparisons on the objects is modified.
  • For any non-null reference value x, x.equals(null) should return false.

An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.

Parameters
o:Object

the reference object with which to compare.

Returns:boolean

true if this object is the same as the obj argument; false otherwise.

Annotations
@Override
getAttributeIndexesback to summary
public int[] getAttributeIndexes()
getDeleteCustomSqlback to summary
public String getDeleteCustomSql()
getDeleteDetailsback to summary
public TableMapping.MutationDetails getDeleteDetails()

Implements org.hibernate.sql.model.TableMapping.getDeleteDetails.

Doc from org.hibernate.sql.model.TableMapping.getDeleteDetails.

Details for deleting from this table

Annotations
@Override
getDeleteExpectationback to summary
public Expectation getDeleteExpectation()
getInsertCustomSqlback to summary
public String getInsertCustomSql()
getInsertDetailsback to summary
public TableMapping.MutationDetails getInsertDetails()

Implements org.hibernate.sql.model.TableMapping.getInsertDetails.

Doc from org.hibernate.sql.model.TableMapping.getInsertDetails.

Details for insertion into this table

Annotations
@Override
getInsertExpectationback to summary
public Expectation getInsertExpectation()
getKeyDetailsback to summary
public TableDetails.KeyDetails getKeyDetails()

Implements org.hibernate.metamodel.mapping.TableDetails.getKeyDetails.

Doc from org.hibernate.metamodel.mapping.TableDetails.getKeyDetails.

Details about the primary-key of this table

Annotations
@Override
getKeyMappingback to summary
public EntityTableMapping.KeyMapping getKeyMapping()
getRelativePositionback to summary
public int getRelativePosition()

Implements org.hibernate.sql.model.TableMapping.getRelativePosition.

Doc from org.hibernate.sql.model.TableMapping.getRelativePosition.

The position of the table relative to others for the MutationTarget

Annotations
@Override
getTableNameback to summary
public String getTableName()

Implements org.hibernate.sql.model.TableMapping.getTableName.

Doc from org.hibernate.sql.model.TableMapping.getTableName.

The name of the mapped table

Annotations
@Override
getUpdateCustomSqlback to summary
public String getUpdateCustomSql()
getUpdateDetailsback to summary
public TableMapping.MutationDetails getUpdateDetails()

Implements org.hibernate.sql.model.TableMapping.getUpdateDetails.

Doc from org.hibernate.sql.model.TableMapping.getUpdateDetails.

Details for updating this table

Annotations
@Override
getUpdateExpectationback to summary
public Expectation getUpdateExpectation()
hasColumnsback to summary
public boolean hasColumns()
hashCodeback to summary
public int hashCode()

Overrides java.lang.Object.hashCode.

Doc from java.lang.Object.hashCode.

Returns a hash code value for the object. This method is supported for the benefit of hash tables such as those provided by java.util.HashMap.

The general contract of hashCode is:

  • Whenever it is invoked on the same object more than once during an execution of a Java application, the hashCode method must consistently return the same integer, provided no information used in equals comparisons on the object is modified. This integer need not remain consistent from one execution of an application to another execution of the same application.
  • If two objects are equal according to the equals method, then calling the hashCode method on each of the two objects must produce the same integer result.
  • It is not required that if two objects are unequal according to the equals method, then calling the hashCode method on each of the two objects must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal objects may improve the performance of hash tables.
Returns:int

a hash code value for this object.

Annotations
@Override
isCascadeDeleteEnabledback to summary
public boolean isCascadeDeleteEnabled()

Implements org.hibernate.sql.model.TableMapping.isCascadeDeleteEnabled.

Doc from org.hibernate.sql.model.TableMapping.isCascadeDeleteEnabled.

Whether deletions are cascaded to this table at the database level.

Annotations
@Override
isDeleteCallableback to summary
public boolean isDeleteCallable()
isIdentifierTableback to summary
public boolean isIdentifierTable()

Implements org.hibernate.sql.model.TableMapping.isIdentifierTable.

Doc from org.hibernate.sql.model.TableMapping.isIdentifierTable.

Whether this table holds the identifier for the MutationTarget

Annotations
@Override
isInsertCallableback to summary
public boolean isInsertCallable()
isInverseback to summary
public boolean isInverse()

Implements org.hibernate.sql.model.TableMapping.isInverse.

Doc from org.hibernate.sql.model.TableMapping.isInverse.

Whether the table is mapped as inverse

Annotations
@Override
isOptionalback to summary
public boolean isOptional()

Implements org.hibernate.sql.model.TableMapping.isOptional.

Doc from org.hibernate.sql.model.TableMapping.isOptional.

Whether the table is mapped as optional

Annotations
@Override
isUpdateCallableback to summary
public boolean isUpdateCallable()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object.

Returns:String

a string representation of the object.

Annotations
@Override
org.hibernate.persister.entity.mutation back to summary

private final Enum EntityTableMapping.Flag

extends Enum<EntityTableMapping.Flag>
Class Inheritance

Field Summary

Modifier and TypeField and Description
public static final EntityTableMapping.Flag
public static final EntityTableMapping.Flag
public static final EntityTableMapping.Flag
public static final EntityTableMapping.Flag

Constructor Summary

AccessConstructor and Description
private
Flag()

Method Summary

Modifier and TypeMethod and Description
public static EntityTableMapping.Flag
public static EntityTableMapping.Flag[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

CASCADE_DELETEback to summary
public static final EntityTableMapping.Flag CASCADE_DELETE
ID_TABLEback to summary
public static final EntityTableMapping.Flag ID_TABLE
INVERSEback to summary
public static final EntityTableMapping.Flag INVERSE
OPTIONALback to summary
public static final EntityTableMapping.Flag OPTIONAL

Constructor Detail

Flagback to summary
private Flag()

Method Detail

valueOfback to summary
public static EntityTableMapping.Flag valueOf(String name)
valuesback to summary
public static EntityTableMapping.Flag[] values()
org.hibernate.persister.entity.mutation back to summary

public Class EntityTableMapping.KeyColumn

extends Object
implements KeyColumn
Class Inheritance
  • java.lang.Object
  • org.hibernate.persister.entity.mutation.EntityTableMapping.KeyColumn
All Implemented Interfaces
org.hibernate.metamodel.mapping.TableDetails.KeyColumn, org.hibernate.metamodel.mapping.SelectableMapping, org.hibernate.metamodel.mapping.SqlTypedMapping

Field Summary

Modifier and TypeField and Description
private final String
private final boolean
private final JdbcMapping
private final String
private final String

Constructor Summary

AccessConstructor and Description
public
KeyColumn(String tableName, String columnName, String writeExpression, boolean formula, JdbcMapping jdbcMapping)

Method Summary

Modifier and TypeMethod and Description
public String
public String
public String
getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.SelectableMapping.getContainingTableExpression.

The name of the table to which this selectable is mapped
public String
getCustomReadExpression()

Implements org.hibernate.metamodel.mapping.SelectableMapping.getCustomReadExpression.

The selection's read expression accounting for formula treatment as well as ColumnTransformer#read()
public String
public JdbcMapping
getJdbcMapping()

Implements org.hibernate.metamodel.mapping.TableDetails.KeyColumn.getJdbcMapping.

Describes the mapping between object and relational for this column
public Long
public Integer
public Integer
public String
public String
public boolean
isFormula()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isFormula.

Is the mapping a formula instead of a physical column?
public boolean
public boolean
isNullable()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isNullable.

Is the mapping considered nullable?
public boolean
public boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

columnNameback to summary
private final String columnName
formulaback to summary
private final boolean formula
jdbcMappingback to summary
private final JdbcMapping jdbcMapping
tableNameback to summary
private final String tableName
writeExpressionback to summary
private final String writeExpression

Constructor Detail

KeyColumnback to summary
public KeyColumn(String tableName, String columnName, String writeExpression, boolean formula, JdbcMapping jdbcMapping)

Method Detail

getColumnDefinitionback to summary
public String getColumnDefinition()

Implements org.hibernate.metamodel.mapping.SqlTypedMapping.getColumnDefinition.

Annotations
@Override
getColumnNameback to summary
public String getColumnName()

Implements org.hibernate.metamodel.mapping.TableDetails.KeyColumn.getColumnName.

Doc from org.hibernate.metamodel.mapping.TableDetails.KeyColumn.getColumnName.

The name of the column

getContainingTableExpressionback to summary
public String getContainingTableExpression()

Implements org.hibernate.metamodel.mapping.SelectableMapping.getContainingTableExpression.

Doc from org.hibernate.metamodel.mapping.SelectableMapping.getContainingTableExpression.

The name of the table to which this selectable is mapped

Annotations
@Override
getCustomReadExpressionback to summary
public String getCustomReadExpression()

Implements org.hibernate.metamodel.mapping.SelectableMapping.getCustomReadExpression.

Doc from org.hibernate.metamodel.mapping.SelectableMapping.getCustomReadExpression.

The selection's read expression accounting for formula treatment as well as ColumnTransformer#read()

Annotations
@Override
getCustomWriteExpressionback to summary
public String getCustomWriteExpression()

Implements org.hibernate.metamodel.mapping.SelectableMapping.getCustomWriteExpression.

Doc from org.hibernate.metamodel.mapping.SelectableMapping.getCustomWriteExpression.

The selection's write expression accounting ColumnTransformer#write()

Annotations
@Override
getJdbcMappingback to summary
public JdbcMapping getJdbcMapping()

Implements org.hibernate.metamodel.mapping.TableDetails.KeyColumn.getJdbcMapping.

Doc from org.hibernate.metamodel.mapping.TableDetails.KeyColumn.getJdbcMapping.

Describes the mapping between object and relational for this column

Annotations
@Override
getLengthback to summary
public Long getLength()

Implements org.hibernate.metamodel.mapping.SqlTypedMapping.getLength.

Annotations
@Override
getPrecisionback to summary
public Integer getPrecision()

Implements org.hibernate.metamodel.mapping.SqlTypedMapping.getPrecision.

Annotations
@Override
getScaleback to summary
public Integer getScale()

Implements org.hibernate.metamodel.mapping.SqlTypedMapping.getScale.

Annotations
@Override
getSelectionExpressionback to summary
public String getSelectionExpression()

Implements org.hibernate.metamodel.mapping.SelectableMapping.getSelectionExpression.

Doc from org.hibernate.metamodel.mapping.SelectableMapping.getSelectionExpression.

The selection's expression. This is the column name or formula

Annotations
@Override
getWriteExpressionback to summary
public String getWriteExpression()

Overrides default org.hibernate.metamodel.mapping.SelectableMapping.getWriteExpression.

Annotations
@Override
isFormulaback to summary
public boolean isFormula()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isFormula.

Doc from org.hibernate.metamodel.mapping.SelectableMapping.isFormula.

Is the mapping a formula instead of a physical column?

Annotations
@Override
isInsertableback to summary
public boolean isInsertable()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isInsertable.

Annotations
@Override
isNullableback to summary
public boolean isNullable()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isNullable.

Doc from org.hibernate.metamodel.mapping.SelectableMapping.isNullable.

Is the mapping considered nullable?

Annotations
@Override
isPartitionedback to summary
public boolean isPartitioned()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isPartitioned.

Annotations
@Override
isUpdateableback to summary
public boolean isUpdateable()

Implements org.hibernate.metamodel.mapping.SelectableMapping.isUpdateable.

Annotations
@Override
org.hibernate.persister.entity.mutation back to summary

public Class EntityTableMapping.KeyMapping

extends Object
implements KeyDetails, SelectableMappings
Class Inheritance
  • java.lang.Object
  • org.hibernate.persister.entity.mutation.EntityTableMapping.KeyMapping
All Implemented Interfaces
org.hibernate.metamodel.mapping.SelectableMappings, org.hibernate.metamodel.mapping.TableDetails.KeyDetails

Field Summary

Modifier and TypeField and Description
private final ModelPart
private final List<EntityTableMapping.KeyColumn>

Constructor Summary

AccessConstructor and Description
public
KeyMapping(List<EntityTableMapping.KeyColumn> keyColumns, ModelPart identifierPart)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public void
public int
forEachSelectable(int offset, SelectableConsumer consumer)

Implements org.hibernate.metamodel.mapping.SelectableMappings.forEachSelectable.

Visit each contained selectable mapping.
public int
public int
public EntityTableMapping.KeyColumn
getKeyColumn(int position)

Implements org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getKeyColumn.

Get a key column by relative position
public List<EntityTableMapping.KeyColumn>
getKeyColumns()

Implements org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getKeyColumns.

Group of columns defined on the primary key
public SelectableMapping
getSelectable(int columnIndex)

Implements org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Get the selectable at the given position
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

identifierPartback to summary
private final ModelPart identifierPart
keyColumnsback to summary
private final List<EntityTableMapping.KeyColumn> keyColumns

Constructor Detail

KeyMappingback to summary
public KeyMapping(List<EntityTableMapping.KeyColumn> keyColumns, ModelPart identifierPart)

Method Detail

breakDownKeyJdbcValuesback to summary
public void breakDownKeyJdbcValues(Object domainValue, EntityTableMapping.KeyValueConsumer valueConsumer, SharedSessionContractImplementor session)
forEachKeyColumnback to summary
public void forEachKeyColumn(TableDetails.KeyColumnConsumer consumer)

Implements org.hibernate.metamodel.mapping.TableDetails.KeyDetails.forEachKeyColumn.

Doc from org.hibernate.metamodel.mapping.TableDetails.KeyDetails.forEachKeyColumn.

Visit each key column

Annotations
@Override
forEachKeyColumnback to summary
public void forEachKeyColumn(Consumer<EntityTableMapping.KeyColumn> keyColumnConsumer)
forEachSelectableback to summary
public int forEachSelectable(int offset, SelectableConsumer consumer)

Implements org.hibernate.metamodel.mapping.SelectableMappings.forEachSelectable.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.forEachSelectable.

Visit each contained selectable mapping. As the selectables are iterated, we call `SelectionConsumer` passing along `offset` + our current iteration index. The return is the number of selectables we directly contain

Annotations
@Override
getColumnCountback to summary
public int getColumnCount()

Implements org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getColumnCount.

Doc from org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getColumnCount.

Number of columns

Annotations
@Override
getJdbcTypeCountback to summary
public int getJdbcTypeCount()

Implements org.hibernate.metamodel.mapping.SelectableMappings.getJdbcTypeCount.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.getJdbcTypeCount.

The number of selectables

Annotations
@Override
getKeyColumnback to summary
public EntityTableMapping.KeyColumn getKeyColumn(int position)

Implements org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getKeyColumn.

Doc from org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getKeyColumn.

Get a key column by relative position

Annotations
@Override
getKeyColumnsback to summary
public List<EntityTableMapping.KeyColumn> getKeyColumns()

Implements org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getKeyColumns.

Doc from org.hibernate.metamodel.mapping.TableDetails.KeyDetails.getKeyColumns.

Group of columns defined on the primary key

Annotations
@Override
getSelectableback to summary
public SelectableMapping getSelectable(int columnIndex)

Implements org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Doc from org.hibernate.metamodel.mapping.SelectableMappings.getSelectable.

Get the selectable at the given position

Annotations
@Override
org.hibernate.persister.entity.mutation back to summary

public Interface EntityTableMapping.KeyValueConsumer

Annotations
@FunctionalInterface

Method Summary

Modifier and TypeMethod and Description
public void
consume(Object jdbcValue, EntityTableMapping.KeyColumn columnMapping)

Method Detail

consumeback to summary
public void consume(Object jdbcValue, EntityTableMapping.KeyColumn columnMapping)