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,SortableValue,Value
public class OneToOne extends ToOne
A mapping model object representing a many-to-one association.- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.hibernate.mapping.ToOne
referencedPropertyName
-
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGY
-
-
Constructor Summary
Constructors Constructor Description OneToOne(MetadataBuildingContext buildingContext, Table table, PersistentClass owner)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectaccept(ValueVisitor visitor)OneToOnecopy()voidcreateUniqueKey()Iterator<Selectable>getConstraintColumnIterator()List<Column>getConstraintColumns()Same asValue.getColumns()except it returns the PK for the non-owning side of a one-to-one association.StringgetEntityName()ForeignKeyDirectiongetForeignKeyType()Returns the foreignKeyType.KeyValuegetIdentifier()Returns the identifier.StringgetMappedByProperty()StringgetPropertyName()TypegetType()List<Selectable>getVirtualSelectables()Same asValue.getSelectables()except it returns the PK for the non-owning side of a one-to-one association.booleanisConstrained()Returns the constrained.booleanisNullable()booleanisSame(OneToOne other)booleanisSame(ToOne other)voidsetConstrained(boolean constrained)Sets the constrained.voidsetForeignKeyType(ForeignKeyDirection foreignKeyType)Sets the foreignKeyType.voidsetIdentifier(KeyValue identifier)Sets the identifier.voidsetMappedByProperty(String mappedByProperty)voidsetPropertyName(String propertyName)-
Methods inherited from class org.hibernate.mapping.ToOne
createForeignKey, createForeignKey, getFetchMode, getReferencedEntityName, getReferencedPropertyName, isLazy, isReferenceToPrimaryKey, isSame, isSorted, isTypeSpecified, isUnwrapProxy, isUnwrapProxyImplicit, isValid, setFetchMode, setLazy, setReferencedEntityName, setReferencedPropertyName, setReferenceToPrimaryKey, setSorted, setTypeUsingReflection, setUnwrapProxy, setUnwrapProxyImplicit, sortProperties
-
Methods inherited from class org.hibernate.mapping.SimpleValue
addColumn, addColumn, addFormula, copyTypeFrom, createForeignKeyOfEntity, createGenerator, createParameterImpl, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumnIterator, getColumns, getColumnSpan, getColumnUpdateability, getCustomIdGeneratorCreator, getForeignKeyDefinition, getForeignKeyName, getIdentifierGenerator, getIdentifierGeneratorParameters, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getOnDeleteAction, getSelectables, getServiceRegistry, getTable, getTypeConfiguration, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isColumnInsertable, isColumnUpdateable, isForeignKeyEnabled, isIdentityColumn, isLob, isNationalized, isPartitionKey, isSame, isSame, isSimpleValue, isUpdateable, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeParameterImpl, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setCascadeDeleteEnabled, setCustomIdGeneratorCreator, setForeignKeyDefinition, setForeignKeyName, setIdentifierGeneratorParameters, setIdentifierGeneratorProperties, setIdentifierGeneratorProperties, setIdentifierGeneratorStrategy, setJpaAttributeConverterDescriptor, setNullValue, setOnDeleteAction, setPartitionKey, setTable, setTypeName, setTypeParameters, setTypeParameters, sortColumns, toString
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.hibernate.mapping.KeyValue
createIdentifierGenerator, createIdentifierGenerator
-
Methods inherited from interface org.hibernate.mapping.Value
getSelectableType
-
-
-
-
Constructor Detail
-
OneToOne
public OneToOne(MetadataBuildingContext buildingContext, Table table, PersistentClass owner) throws MappingException
- Throws:
MappingException
-
-
Method Detail
-
copy
public OneToOne copy()
-
getPropertyName
public String getPropertyName()
- Overrides:
getPropertyNamein classToOne
-
setPropertyName
public void setPropertyName(String propertyName)
- Overrides:
setPropertyNamein classToOne
-
getEntityName
public String getEntityName()
-
getType
public Type getType() throws MappingException
- Throws:
MappingException
-
createUniqueKey
public void createUniqueKey()
- Specified by:
createUniqueKeyin interfaceValue- Overrides:
createUniqueKeyin classSimpleValue
-
getVirtualSelectables
public List<Selectable> getVirtualSelectables()
Description copied from interface:ValueSame asValue.getSelectables()except it returns the PK for the non-owning side of a one-to-one association.
-
getConstraintColumns
public List<Column> getConstraintColumns()
Description copied from interface:ValueSame asValue.getColumns()except it returns the PK for the non-owning side of a one-to-one association.
-
getConstraintColumnIterator
public Iterator<Selectable> getConstraintColumnIterator()
- Overrides:
getConstraintColumnIteratorin classSimpleValue
-
isConstrained
public boolean isConstrained()
Returns the constrained.- Overrides:
isConstrainedin classSimpleValue- 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)
-
getMappedByProperty
public String getMappedByProperty()
-
setMappedByProperty
public void setMappedByProperty(String mappedByProperty)
-
-