Package org.hibernate.mapping
Class ToOne
- java.lang.Object
-
- org.hibernate.mapping.SimpleValue
-
- org.hibernate.mapping.ToOne
-
- All Implemented Interfaces:
Serializable,Fetchable,KeyValue,SortableValue,Value
public abstract class ToOne extends SimpleValue implements Fetchable, SortableValue
A mapping model object representing an association where the target side has cardinality one.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected StringreferencedPropertyName-
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGY
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedToOne(MetadataBuildingContext buildingContext, Table table)protectedToOne(ToOne original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectaccept(ValueVisitor visitor)voidcreateForeignKey()voidcreateForeignKey(PersistentClass referencedEntity, org.hibernate.boot.model.internal.AnnotatedJoinColumns joinColumns)FetchModegetFetchMode()StringgetPropertyName()StringgetReferencedEntityName()StringgetReferencedPropertyName()booleanisLazy()booleanisReferenceToPrimaryKey()booleanisSame(SimpleValue other)booleanisSame(ToOne other)booleanisSorted()booleanisTypeSpecified()booleanisUnwrapProxy()booleanisUnwrapProxyImplicit()booleanisValid(Mapping mapping)voidsetFetchMode(FetchMode fetchMode)voidsetLazy(boolean lazy)voidsetPropertyName(String propertyName)voidsetReferencedEntityName(String referencedEntityName)voidsetReferencedPropertyName(String name)voidsetReferenceToPrimaryKey(boolean referenceToPrimaryKey)voidsetSorted(boolean sorted)voidsetTypeUsingReflection(String className, String propertyName)voidsetUnwrapProxy(boolean unwrapProxy)voidsetUnwrapProxyImplicit(boolean unwrapProxyImplicit)Related to HHH-13658 - keep track of whether `unwrapProxy` is an implicit value for reference laterint[]sortProperties()-
Methods inherited from class org.hibernate.mapping.SimpleValue
addColumn, addColumn, addFormula, copyTypeFrom, createForeignKeyOfEntity, createGenerator, createParameterImpl, createUniqueKey, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumnIterator, getColumns, getColumnSpan, getColumnUpdateability, getConstraintColumnIterator, getCustomIdGeneratorCreator, getForeignKeyDefinition, getForeignKeyName, getIdentifierGenerator, getIdentifierGeneratorParameters, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getOnDeleteAction, getSelectables, getServiceRegistry, getTable, getTypeConfiguration, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isColumnInsertable, isColumnUpdateable, isConstrained, isForeignKeyEnabled, isIdentityColumn, isLob, isNationalized, isNullable, 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, copy, getConstraintColumns, getExtraCreateTableInfo, getSelectableType, getType, getVirtualSelectables
-
-
-
-
Field Detail
-
referencedPropertyName
protected String referencedPropertyName
-
-
Constructor Detail
-
ToOne
protected ToOne(MetadataBuildingContext buildingContext, Table table)
-
ToOne
protected ToOne(ToOne original)
-
-
Method Detail
-
getFetchMode
public FetchMode getFetchMode()
- Specified by:
getFetchModein interfaceFetchable- Specified by:
getFetchModein interfaceValue- Overrides:
getFetchModein classSimpleValue
-
setFetchMode
public void setFetchMode(FetchMode fetchMode)
- Specified by:
setFetchModein interfaceFetchable
-
getReferencedPropertyName
public String getReferencedPropertyName()
-
setReferencedPropertyName
public void setReferencedPropertyName(String name)
-
getReferencedEntityName
public String getReferencedEntityName()
-
setReferencedEntityName
public void setReferencedEntityName(String referencedEntityName)
-
getPropertyName
public String getPropertyName()
-
setPropertyName
public void setPropertyName(String propertyName)
-
setTypeUsingReflection
public void setTypeUsingReflection(String className, String propertyName) throws MappingException
- Specified by:
setTypeUsingReflectionin interfaceValue- Overrides:
setTypeUsingReflectionin classSimpleValue- Throws:
MappingException
-
isTypeSpecified
public boolean isTypeSpecified()
- Overrides:
isTypeSpecifiedin classSimpleValue
-
accept
public Object accept(ValueVisitor visitor)
- Specified by:
acceptin interfaceValue- Overrides:
acceptin classSimpleValue
-
isSame
public boolean isSame(SimpleValue other)
- Overrides:
isSamein classSimpleValue
-
isSame
public boolean isSame(ToOne other)
-
isValid
public boolean isValid(Mapping mapping) throws MappingException
- Specified by:
isValidin interfaceValue- Overrides:
isValidin classSimpleValue- Throws:
MappingException
-
isUnwrapProxy
public boolean isUnwrapProxy()
-
setUnwrapProxy
public void setUnwrapProxy(boolean unwrapProxy)
-
isUnwrapProxyImplicit
public boolean isUnwrapProxyImplicit()
-
setUnwrapProxyImplicit
public void setUnwrapProxyImplicit(boolean unwrapProxyImplicit)
Related to HHH-13658 - keep track of whether `unwrapProxy` is an implicit value for reference later
-
isReferenceToPrimaryKey
public boolean isReferenceToPrimaryKey()
-
setReferenceToPrimaryKey
public void setReferenceToPrimaryKey(boolean referenceToPrimaryKey)
-
isSorted
public boolean isSorted()
- Specified by:
isSortedin interfaceSortableValue
-
setSorted
public void setSorted(boolean sorted)
-
sortProperties
public int[] sortProperties()
- Specified by:
sortPropertiesin interfaceSortableValue
-
createForeignKey
public void createForeignKey(PersistentClass referencedEntity, org.hibernate.boot.model.internal.AnnotatedJoinColumns joinColumns)
- Overrides:
createForeignKeyin classSimpleValue
-
createForeignKey
public void createForeignKey()
- Specified by:
createForeignKeyin interfaceValue- Overrides:
createForeignKeyin classSimpleValue
-
-