Top Description Fields Constructors Methods
org.hibernate.boot.model.internal

public Class OneToOneSecondPass

extends Object
implements SecondPass
Class Inheritance
All Implemented Interfaces
org.hibernate.boot.spi.SecondPass, java.io.Serializable
Imports
java.util.Map, org.hibernate.AnnotationException, .MappingException, org.hibernate.annotations.LazyGroup, .NotFoundAction, .OnDeleteAction, org.hibernate.annotations.common.reflection.XClass, .XProperty, org.hibernate.boot.spi.MetadataBuildingContext, .PropertyData, .SecondPass, org.hibernate.mapping.Column, .Component, .DependantValue, .Join, .KeyValue, .ManyToOne, .OneToOne, .PersistentClass, .Property, .SortableValue, org.hibernate.type.ForeignKeyDirection, jakarta.persistence.ForeignKey

We have to handle jakarta.persistence.OneToOne associations in a second pass.

Field Summary

Modifier and TypeField and Description
private final MetadataBuildingContext
private final String
private final PropertyData
private final AnnotatedJoinColumns
private final String
private final NotFoundAction
private final OnDeleteAction
private final boolean
private final String
private final PropertyHolder
private final XClass

Constructor Summary

AccessConstructor and Description
public
OneToOneSecondPass(String mappedBy, String ownerEntity, String ownerProperty, PropertyHolder propertyHolder, PropertyData inferredData, XClass targetEntity, NotFoundAction notFoundAction, OnDeleteAction onDeleteAction, boolean optional, String cascadeStrategy, AnnotatedJoinColumns columns, MetadataBuildingContext buildingContext)

Method Summary

Modifier and TypeMethod and Description
private void
bindOwned(Map<String, PersistentClass> persistentClasses, OneToOne oneToOne, String propertyName, Property property)

private void
bindTargetManyToOne(Map<String, PersistentClass> persistentClasses, OneToOne oneToOne, Property property, PersistentClass targetEntity, Property targetProperty)

private void
bindUnowned(Map<String, PersistentClass> persistentClasses, OneToOne oneToOne, Property property)

private Join
buildJoinFromMappedBySide(PersistentClass persistentClass, Property otherSideProperty, Join originalJoin)

Builds the Join instance for the unowned side of a OneToOne association using a join table.

public void
doSecondPass(Map<String, PersistentClass> persistentClasses)

Implements org.hibernate.boot.spi.SecondPass.doSecondPass.

Perform the operation
private ForeignKeyDirection
private Property
targetProperty(OneToOne oneToOne, PersistentClass targetEntity)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

buildingContextback to summary
private final MetadataBuildingContext buildingContext
cascadeStrategyback to summary
private final String cascadeStrategy
inferredDataback to summary
private final PropertyData inferredData
joinColumnsback to summary
private final AnnotatedJoinColumns joinColumns
mappedByback to summary
private final String mappedBy
notFoundActionback to summary
private final NotFoundAction notFoundAction
onDeleteActionback to summary
private final OnDeleteAction onDeleteAction
optionalback to summary
private final boolean optional
ownerEntityback to summary
private final String ownerEntity
propertyHolderback to summary
private final PropertyHolder propertyHolder
targetEntityback to summary
private final XClass targetEntity

Constructor Detail

OneToOneSecondPassback to summary
public OneToOneSecondPass(String mappedBy, String ownerEntity, String ownerProperty, PropertyHolder propertyHolder, PropertyData inferredData, XClass targetEntity, NotFoundAction notFoundAction, OnDeleteAction onDeleteAction, boolean optional, String cascadeStrategy, AnnotatedJoinColumns columns, MetadataBuildingContext buildingContext)

Method Detail

bindOwnedback to summary
private void bindOwned(Map<String, PersistentClass> persistentClasses, OneToOne oneToOne, String propertyName, Property property)
bindTargetManyToOneback to summary
private void bindTargetManyToOne(Map<String, PersistentClass> persistentClasses, OneToOne oneToOne, Property property, PersistentClass targetEntity, Property targetProperty)
bindUnownedback to summary
private void bindUnowned(Map<String, PersistentClass> persistentClasses, OneToOne oneToOne, Property property)
buildJoinFromMappedBySideback to summary
private Join buildJoinFromMappedBySide(PersistentClass persistentClass, Property otherSideProperty, Join originalJoin)

Builds the Join instance for the unowned side of a OneToOne association using a join table. From the mappedBy side we should not create neither the PK, nor the FK, this is all handled from the owning side.

doSecondPassback to summary
public void doSecondPass(Map<String, PersistentClass> persistentClasses) throws MappingException

Implements org.hibernate.boot.spi.SecondPass.doSecondPass.

Doc from org.hibernate.boot.spi.SecondPass.doSecondPass.

Perform the operation

Annotations
@Override
getForeignKeyDirectionback to summary
private ForeignKeyDirection getForeignKeyDirection()
targetPropertyback to summary
private Property targetProperty(OneToOne oneToOne, PersistentClass targetEntity)