Top Description Fields Constructors Methods
org.hibernate.mapping

public Class OneToOne

extends ToOne
Class Inheritance
Imports
java.util.Iterator, .List, .Objects, org.hibernate.MappingException, org.hibernate.boot.spi.MetadataBuildingContext, org.hibernate.type.ForeignKeyDirection, .Type

A mapping model object representing a many-to-one association.
Author
Gavin King

Field Summary

Modifier and TypeField and Description
private boolean
private final String
private ForeignKeyDirection
private KeyValue
private String
private String
Inherited from org.hibernate.mapping.ToOne:
referencedPropertyName

Constructor Summary

AccessConstructor and Description
public
OneToOne(MetadataBuildingContext buildingContext, Table table, PersistentClass owner)

private
OneToOne(OneToOne original)

Method Summary

Modifier and TypeMethod and Description
public Object
public OneToOne
public void
public Iterator<Selectable>
public List<Column>
getConstraintColumns()

Overrides default org.hibernate.mapping.Value.getConstraintColumns.

Same as getColumns() except it returns the PK for the non-owning side of a one-to-one association.
public String
public ForeignKeyDirection

Returns:

AssociationType.ForeignKeyType
getForeignKeyType
()

Returns the foreignKeyType.

public KeyValue

Returns:

Value
getIdentifier
()

Returns the identifier.

public String
public String
public Type
public List<Selectable>
getVirtualSelectables()

Overrides default org.hibernate.mapping.Value.getVirtualSelectables.

Same as getSelectables() except it returns the PK for the non-owning side of a one-to-one association.
public boolean

Returns:

boolean
isConstrained
()

Overrides org.hibernate.mapping.SimpleValue.isConstrained.

Returns the constrained.
public boolean
public boolean
public boolean
public void
setConstrained(boolean
The constrained to set
constrained
)

Sets the constrained.

public void
setForeignKeyType(ForeignKeyDirection
The foreignKeyType to set
foreignKeyType
)

Sets the foreignKeyType.

public void
setIdentifier(KeyValue
The identifier to set
identifier
)

Sets the identifier.

public void
setMappedByProperty(String mappedByProperty)

public void
Inherited from org.hibernate.mapping.ToOne:
createForeignKeycreateForeignKeygetFetchModegetReferencedEntityNamegetReferencedPropertyNameisLazyisReferenceToPrimaryKeyisSameisSortedisTypeSpecifiedisUnwrapProxyisUnwrapProxyImplicitisValidsetFetchModesetLazysetReferencedEntityNamesetReferencedPropertyNamesetReferenceToPrimaryKeysetSortedsetTypeUsingReflectionsetUnwrapProxysetUnwrapProxyImplicitsortProperties

Field Detail

constrainedback to summary
private boolean constrained
entityNameback to summary
private final String entityName
foreignKeyTypeback to summary
private ForeignKeyDirection foreignKeyType
identifierback to summary
private KeyValue identifier
mappedByPropertyback to summary
private String mappedByProperty
propertyNameback to summary
private String propertyName

Hides org.hibernate.mapping.ToOne.propertyName.

Constructor Detail

OneToOneback to summary
public OneToOne(MetadataBuildingContext buildingContext, Table table, PersistentClass owner) throws MappingException
OneToOneback to summary
private OneToOne(OneToOne original)

Method Detail

acceptback to summary
public Object accept(ValueVisitor visitor)

Overrides org.hibernate.mapping.ToOne.accept.

Implements org.hibernate.mapping.Value.accept.

copyback to summary
public OneToOne copy()

Implements org.hibernate.mapping.Value.copy.

Annotations
@Override
createUniqueKeyback to summary
public void createUniqueKey()

Overrides org.hibernate.mapping.SimpleValue.createUniqueKey.

Implements org.hibernate.mapping.Value.createUniqueKey.

Annotations
@Override
getConstraintColumnIteratorback to summary
public Iterator<Selectable> getConstraintColumnIterator()

Overrides org.hibernate.mapping.SimpleValue.getConstraintColumnIterator.

Deprecated

for removal since 6.3.

Use getSelectables() instead

Annotations
@Deprecated
forRemoval:true
since:6.3
@Override
getConstraintColumnsback to summary
public List<Column> getConstraintColumns()

Overrides default org.hibernate.mapping.Value.getConstraintColumns.

Doc from org.hibernate.mapping.Value.getConstraintColumns.

Same as getColumns() except it returns the PK for the non-owning side of a one-to-one association.

getEntityNameback to summary
public String getEntityName()
getForeignKeyTypeback to summary
public ForeignKeyDirection getForeignKeyType()

Returns the foreignKeyType.

Returns:ForeignKeyDirection

AssociationType.ForeignKeyType

getIdentifierback to summary
public KeyValue getIdentifier()

Returns the identifier.

Returns:KeyValue

Value

getMappedByPropertyback to summary
public String getMappedByProperty()
getPropertyNameback to summary
public String getPropertyName()

Overrides org.hibernate.mapping.ToOne.getPropertyName.

getTypeback to summary
public Type getType() throws MappingException

Implements org.hibernate.mapping.Value.getType.

getVirtualSelectablesback to summary
public List<Selectable> getVirtualSelectables()

Overrides default org.hibernate.mapping.Value.getVirtualSelectables.

Doc from org.hibernate.mapping.Value.getVirtualSelectables.

Same as getSelectables() except it returns the PK for the non-owning side of a one-to-one association.

Annotations
@Override
isConstrainedback to summary
public boolean isConstrained()

Overrides org.hibernate.mapping.SimpleValue.isConstrained.

Returns the constrained.

Returns:boolean

boolean

isNullableback to summary
public boolean isNullable()

Overrides org.hibernate.mapping.SimpleValue.isNullable.

Implements org.hibernate.mapping.Value.isNullable.

isSameback to summary
public boolean isSame(ToOne other)

Overrides org.hibernate.mapping.ToOne.isSame.

Annotations
@Override
isSameback to summary
public boolean isSame(OneToOne other)
setConstrainedback to summary
public void setConstrained(boolean constrained)

Sets the constrained.

Parameters
constrained:boolean

The constrained to set

setForeignKeyTypeback to summary
public void setForeignKeyType(ForeignKeyDirection foreignKeyType)

Sets the foreignKeyType.

Parameters
foreignKeyType:ForeignKeyDirection

The foreignKeyType to set

setIdentifierback to summary
public void setIdentifier(KeyValue identifier)

Sets the identifier.

Parameters
identifier:KeyValue

The identifier to set

setMappedByPropertyback to summary
public void setMappedByProperty(String mappedByProperty)
setPropertyNameback to summary
public void setPropertyName(String propertyName)

Overrides org.hibernate.mapping.ToOne.setPropertyName.