org.hibernate.mapping

Class OneToOne

Implemented Interfaces:
Fetchable, KeyValue, Serializable, Value

public class OneToOne
extends ToOne

A one-to-one association mapping
Author:
Gavin King

Field Summary

Fields inherited from class org.hibernate.mapping.ToOne

referencedPropertyName, unwrapProxy

Constructor Summary

OneToOne(Table table, PersistentClass owner)

Method Summary

Object
accept(ValueVisitor visitor)
void
createForeignKey()
java.util.List
getConstraintColumns()
String
getEntityName()
ForeignKeyDirection
getForeignKeyType()
Returns the foreignKeyType.
KeyValue
getIdentifier()
Returns the identifier.
String
getPropertyName()
Type
getType()
boolean
isConstrained()
Returns the constrained.
boolean
isNullable()
void
setConstrained(boolean constrained)
Sets the constrained.
void
setEntityName(String propertyName)
void
setForeignKeyType(ForeignKeyDirection foreignKeyType)
Sets the foreignKeyType.
void
setIdentifier(KeyValue identifier)
Sets the identifier.
void
setPropertyName(String propertyName)

Methods inherited from class org.hibernate.mapping.ToOne

accept, createForeignKey, getFetchMode, getReferencedEntityName, getReferencedPropertyName, getType, isEmbedded, isLazy, isTypeSpecified, isUnwrapProxy, isValid, setEmbedded, setFetchMode, setLazy, setReferencedEntityName, setReferencedPropertyName, setTypeUsingReflection, setUnwrapProxy

Methods inherited from class org.hibernate.mapping.SimpleValue

accept, addColumn, addFormula, createForeignKey, createForeignKeyOfEntity, createIdentifierGenerator, getColumnInsertability, getColumnIterator, getColumnSpan, getColumnUpdateability, getConstraintColumns, getFetchMode, getForeignKeyName, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getNullValue, getTable, getType, getTypeName, getTypeParameters, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isIdentityColumn, isNullable, isSimpleValue, isTypeSpecified, isUpdateable, isValid, setAlternateUniqueKey, setCascadeDeleteEnabled, setForeignKeyName, setIdentifierGeneratorProperties, setIdentifierGeneratorStrategy, setNullValue, setTable, setTypeName, setTypeParameters, setTypeUsingReflection, toString

Constructor Details

OneToOne

public OneToOne(Table table,
                PersistentClass owner)
            throws MappingException

Method Details

accept

public Object accept(ValueVisitor visitor)
Specified by:
accept in interface Value
Overrides:
accept in interface ToOne

createForeignKey

public void createForeignKey()
            throws MappingException
Specified by:
createForeignKey in interface Value
Overrides:
createForeignKey in interface ToOne

getConstraintColumns

public java.util.List getConstraintColumns()
Overrides:
getConstraintColumns in interface SimpleValue

getEntityName

public String getEntityName()

getForeignKeyType

public ForeignKeyDirection getForeignKeyType()
Returns the foreignKeyType.
Returns:
AssociationType.ForeignKeyType

getIdentifier

public KeyValue getIdentifier()
Returns the identifier.
Returns:
Value

getPropertyName

public String getPropertyName()

getType

public Type getType()
            throws MappingException
Specified by:
getType in interface Value
Overrides:
getType in interface ToOne

isConstrained

public boolean isConstrained()
Returns the constrained.
Returns:
boolean

isNullable

public boolean isNullable()
Specified by:
isNullable in interface Value
Overrides:
isNullable in interface SimpleValue

setConstrained

public void setConstrained(boolean constrained)
Sets the constrained.
Parameters:
constrained - The constrained to set

setEntityName

public void setEntityName(String propertyName)

setForeignKeyType

public void setForeignKeyType(ForeignKeyDirection foreignKeyType)
Sets the foreignKeyType.
Parameters:
foreignKeyType - The foreignKeyType to set

setIdentifier

public void setIdentifier(KeyValue identifier)
Sets the identifier.
Parameters:
identifier - The identifier to set

setPropertyName

public void setPropertyName(String propertyName)