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 String
referencedPropertyName
-
Fields inherited from class org.hibernate.mapping.SimpleValue
DEFAULT_ID_GEN_STRATEGY
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
ToOne(MetadataBuildingContext buildingContext, Table table)
protected
ToOne(ToOne original)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
accept(ValueVisitor visitor)
void
createForeignKey()
void
createForeignKey(PersistentClass referencedEntity, AnnotatedJoinColumns joinColumns)
FetchMode
getFetchMode()
String
getPropertyName()
String
getReferencedEntityName()
String
getReferencedPropertyName()
boolean
isLazy()
boolean
isReferenceToPrimaryKey()
boolean
isSame(SimpleValue other)
boolean
isSame(ToOne other)
boolean
isSorted()
boolean
isTypeSpecified()
boolean
isUnwrapProxy()
boolean
isUnwrapProxyImplicit()
boolean
isValid(Mapping mapping)
void
setFetchMode(FetchMode fetchMode)
void
setLazy(boolean lazy)
void
setPropertyName(String propertyName)
void
setReferencedEntityName(String referencedEntityName)
void
setReferencedPropertyName(String name)
void
setReferenceToPrimaryKey(boolean referenceToPrimaryKey)
void
setSorted(boolean sorted)
void
setTypeUsingReflection(String className, String propertyName)
void
setUnwrapProxy(boolean unwrapProxy)
void
setUnwrapProxyImplicit(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, getColumns, getColumnSpan, getColumnUpdateability, getConstraintColumnIterator, getCustomIdGeneratorCreator, getForeignKeyDefinition, getForeignKeyName, getIdentifierGeneratorParameters, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getOnDeleteAction, getSelectables, getServiceRegistry, getTable, getTypeConfiguration, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isColumnInsertable, isColumnUpdateable, isConstrained, isForeignKeyEnabled, 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:
getFetchMode
in interfaceFetchable
- Specified by:
getFetchMode
in interfaceValue
- Overrides:
getFetchMode
in classSimpleValue
-
setFetchMode
public void setFetchMode(FetchMode fetchMode)
- Specified by:
setFetchMode
in 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:
setTypeUsingReflection
in interfaceValue
- Overrides:
setTypeUsingReflection
in classSimpleValue
- Throws:
MappingException
-
isTypeSpecified
public boolean isTypeSpecified()
- Overrides:
isTypeSpecified
in classSimpleValue
-
accept
public Object accept(ValueVisitor visitor)
- Specified by:
accept
in interfaceValue
- Overrides:
accept
in classSimpleValue
-
isSame
public boolean isSame(SimpleValue other)
- Overrides:
isSame
in classSimpleValue
-
isSame
public boolean isSame(ToOne other)
-
isValid
public boolean isValid(Mapping mapping) throws MappingException
- Specified by:
isValid
in interfaceValue
- Overrides:
isValid
in 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:
isSorted
in interfaceSortableValue
-
setSorted
public void setSorted(boolean sorted)
-
sortProperties
public int[] sortProperties()
- Specified by:
sortProperties
in interfaceSortableValue
-
createForeignKey
public void createForeignKey(PersistentClass referencedEntity, AnnotatedJoinColumns joinColumns)
- Overrides:
createForeignKey
in classSimpleValue
-
createForeignKey
public void createForeignKey()
- Specified by:
createForeignKey
in interfaceValue
- Overrides:
createForeignKey
in classSimpleValue
-
-