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 simple-point association (ie. a reference to another entity).- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected booleanisUnwrapProxyImplicitprotected StringreferencedPropertyNameprotected booleanreferenceToPrimaryKeyprotected booleanunwrapProxy-
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)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, createForeignKey, createForeignKeyOfEntity, createIdentifierGenerator, createIdentifierGenerator, createParameterImpl, createUniqueKey, disableForeignKey, getAttributeConverterDescriptor, getBuildingContext, getColumn, getColumnInsertability, getColumnIterator, getColumns, getColumnSpan, getColumnUpdateability, getConstraintColumnIterator, getCustomIdGeneratorCreator, getForeignKeyDefinition, getForeignKeyName, getIdentifierGenerator, getIdentifierGeneratorProperties, getIdentifierGeneratorStrategy, getJpaAttributeConverterDescriptor, getMetadata, getNullValue, getSelectables, getServiceRegistry, getTable, getTypeName, getTypeParameters, hasAnyInsertableColumns, hasAnyUpdatableColumns, hasFormula, isAlternateUniqueKey, isCascadeDeleteEnabled, isConstrained, isForeignKeyEnabled, isIdentityColumn, isLob, isNationalized, isNullable, isSame, isSame, isSimpleValue, isUpdateable, isVersion, justAddColumn, justAddColumn, justAddFormula, makeLob, makeNationalized, makeParameterImpl, makeVersion, setAlternateUniqueKey, setAttributeConverterDescriptor, setCascadeDeleteEnabled, setCustomIdGeneratorCreator, setForeignKeyDefinition, setForeignKeyName, setIdentifierGeneratorProperties, setIdentifierGeneratorProperties, setIdentifierGeneratorStrategy, setJpaAttributeConverterDescriptor, setNullValue, 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.Value
copy, getConstraintColumns, getType, getVirtualSelectables
-
-
-
-
Field Detail
-
referencedPropertyName
protected String referencedPropertyName
-
unwrapProxy
protected boolean unwrapProxy
-
isUnwrapProxyImplicit
protected boolean isUnwrapProxyImplicit
-
referenceToPrimaryKey
protected boolean referenceToPrimaryKey
-
-
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
-
-