Package org.hibernate.mapping
Class OneToOne
- java.lang.Object
-
- org.hibernate.mapping.SimpleValue
-
- org.hibernate.mapping.ToOne
-
- org.hibernate.mapping.OneToOne
-
- All Implemented Interfaces:
Serializable,Fetchable,KeyValue,Value
public class OneToOne extends ToOne
A one-to-one association mapping- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.hibernate.mapping.ToOne
referencedPropertyName, referenceToPrimaryKey, unwrapProxy
-
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description OneToOne(MetadataBuildingContext buildingContext, Table table, PersistentClass owner)OneToOne(MetadataImplementor metadata, Table table, PersistentClass owner)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectaccept(ValueVisitor visitor)voidcreateForeignKey()ListgetConstraintColumns()StringgetEntityName()ForeignKeyDirectiongetForeignKeyType()Returns the foreignKeyType.KeyValuegetIdentifier()Returns the identifier.StringgetPropertyName()TypegetType()booleanisConstrained()Returns the constrained.booleanisNullable()booleanisSame(OneToOne other)booleanisSame(ToOne other)voidsetConstrained(boolean constrained)Sets the constrained.voidsetEntityName(String propertyName)voidsetForeignKeyType(ForeignKeyDirection foreignKeyType)Sets the foreignKeyType.voidsetIdentifier(KeyValue identifier)Sets the identifier.voidsetPropertyName(String propertyName)-
Methods inherited from class org.hibernate.mapping.ToOne
getFetchMode, getReferencedEntityName, getReferencedPropertyName, isLazy, isReferenceToPrimaryKey, isSame, isTypeSpecified, isUnwrapProxy, isValid, setFetchMode, setLazy, setReferencedEntityName, setReferencedPropertyName, setReferenceToPrimaryKey, setTypeUsingReflection, setUnwrapProxy
-
Methods inherited from class org.hibernate.mapping.SimpleValue
addColumn, addColumn, addFormula, copyTypeFrom, createForeignKeyOfEntity, createIdentifierGenerator, getColumnInsertability, getColumnIterator, getColumnSpan, getColumnUpdateability, getForeignKeyDefinition, getForeignKeyName, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getMetadata, getNullValue, getServiceRegistry, getTable, getTypeName, getTypeParameters, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isIdentityColumn, isLob, isNationalized, isSame, isSame, isSimpleValue, isUpdateable, isVersion, makeLob, makeNationalized, makeVersion, setAlternateUniqueKey, setCascadeDeleteEnabled, setForeignKeyDefinition, setForeignKeyName, setIdentifierGeneratorProperties, setIdentifierGeneratorStrategy, setJpaAttributeConverterDescriptor, setNullValue, setTable, setTypeName, setTypeParameters, toString
-
-
-
-
Constructor Detail
-
OneToOne
@Deprecated public OneToOne(MetadataImplementor metadata, Table table, PersistentClass owner) throws MappingException
Deprecated.- Throws:
MappingException
-
OneToOne
public OneToOne(MetadataBuildingContext buildingContext, Table table, PersistentClass owner) throws MappingException
- Throws:
MappingException
-
-
Method Detail
-
getPropertyName
public String getPropertyName()
- Overrides:
getPropertyNamein classToOne
-
setPropertyName
public void setPropertyName(String propertyName)
- Overrides:
setPropertyNamein classToOne
-
getEntityName
public String getEntityName()
-
setEntityName
public void setEntityName(String propertyName)
-
getType
public Type getType() throws MappingException
- Specified by:
getTypein interfaceValue- Specified by:
getTypein classToOne- Throws:
MappingException
-
createForeignKey
public void createForeignKey() throws MappingException- Specified by:
createForeignKeyin interfaceValue- Specified by:
createForeignKeyin classToOne- Throws:
MappingException
-
getConstraintColumns
public List getConstraintColumns()
- Overrides:
getConstraintColumnsin classSimpleValue
-
isConstrained
public boolean isConstrained()
Returns the constrained.- Returns:
- boolean
-
getForeignKeyType
public ForeignKeyDirection getForeignKeyType()
Returns the foreignKeyType.- Returns:
- AssociationType.ForeignKeyType
-
getIdentifier
public KeyValue getIdentifier()
Returns the identifier.- Returns:
- Value
-
setConstrained
public void setConstrained(boolean constrained)
Sets the constrained.- Parameters:
constrained- The constrained to set
-
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
-
isNullable
public boolean isNullable()
- Specified by:
isNullablein interfaceValue- Overrides:
isNullablein classSimpleValue
-
accept
public Object accept(ValueVisitor visitor)
-
isSame
public boolean isSame(OneToOne other)
-
-