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 Deprecated Methods Modifier and Type Method Description Object
accept(ValueVisitor visitor)
OneToOne
copy()
void
createUniqueKey()
Iterator<Selectable>
getConstraintColumnIterator()
Deprecated, for removal: This API element is subject to removal in a future version.UseSimpleValue.getSelectables()
insteadList<Column>
getConstraintColumns()
Same asValue.getColumns()
except it returns the PK for the non-owning side of a one-to-one association.String
getEntityName()
ForeignKeyDirection
getForeignKeyType()
Returns the foreignKeyType.KeyValue
getIdentifier()
Returns the identifier.String
getMappedByProperty()
String
getPropertyName()
Type
getType()
List<Selectable>
getVirtualSelectables()
Same asValue.getSelectables()
except it returns the PK for the non-owning side of a one-to-one association.boolean
isConstrained()
Returns the constrained.boolean
isNullable()
boolean
isSame(OneToOne other)
boolean
isSame(ToOne other)
void
setConstrained(boolean constrained)
Sets the constrained.void
setForeignKeyType(ForeignKeyDirection foreignKeyType)
Sets the foreignKeyType.void
setIdentifier(KeyValue identifier)
Sets the identifier.void
setMappedByProperty(String mappedByProperty)
void
setPropertyName(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, 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
checkColumnDuplication, getExtraCreateTableInfo, 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:
getPropertyName
in classToOne
-
setPropertyName
public void setPropertyName(String propertyName)
- Overrides:
setPropertyName
in classToOne
-
getEntityName
public String getEntityName()
-
getType
public Type getType() throws MappingException
- Throws:
MappingException
-
createUniqueKey
public void createUniqueKey()
- Specified by:
createUniqueKey
in interfaceValue
- Overrides:
createUniqueKey
in classSimpleValue
-
getVirtualSelectables
public List<Selectable> getVirtualSelectables()
Description copied from interface:Value
Same 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:Value
Same asValue.getColumns()
except it returns the PK for the non-owning side of a one-to-one association.
-
getConstraintColumnIterator
@Deprecated(forRemoval=true, since="6.3") public Iterator<Selectable> getConstraintColumnIterator()
Deprecated, for removal: This API element is subject to removal in a future version.UseSimpleValue.getSelectables()
instead- Overrides:
getConstraintColumnIterator
in classSimpleValue
-
isConstrained
public boolean isConstrained()
Returns the constrained.- Overrides:
isConstrained
in 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:
isNullable
in interfaceValue
- Overrides:
isNullable
in classSimpleValue
-
accept
public Object accept(ValueVisitor visitor)
-
isSame
public boolean isSame(OneToOne other)
-
getMappedByProperty
public String getMappedByProperty()
-
setMappedByProperty
public void setMappedByProperty(String mappedByProperty)
-
-