Package org.hibernate.mapping
Class ManyToOne
- java.lang.Object
-
- org.hibernate.mapping.SimpleValue
-
- org.hibernate.mapping.ToOne
-
- org.hibernate.mapping.ManyToOne
-
- All Implemented Interfaces:
Serializable
,Fetchable
,KeyValue
,SortableValue
,Value
public class ManyToOne 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 ManyToOne(MetadataBuildingContext buildingContext, Table table)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Object
accept(ValueVisitor visitor)
ManyToOne
copy()
void
createPropertyRefConstraints(Map<String,PersistentClass> persistentClasses)
Creates a foreign key constraint in the case that the foreign key of this association does not reference the primary key of the referenced table, but instead some other unique key.void
createUniqueKey(MetadataBuildingContext context)
NotFoundAction
getNotFoundAction()
Type
getType()
boolean
isIgnoreNotFound()
boolean
isLogicalOneToOne()
boolean
isNullable()
void
markAsLogicalOneToOne()
void
setIgnoreNotFound(boolean ignoreNotFound)
void
setNotFoundAction(NotFoundAction notFoundAction)
-
Methods inherited from class org.hibernate.mapping.ToOne
createForeignKey, createForeignKey, getFetchMode, getPropertyName, getReferencedEntityName, getReferencedPropertyName, isLazy, isReferenceToPrimaryKey, isSame, isSame, isSorted, isTypeSpecified, isUnwrapProxy, isUnwrapProxyImplicit, isValid, setFetchMode, setLazy, setPropertyName, 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, 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, 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, getConstraintColumns, getExtraCreateTableInfo, getSelectableType, getVirtualSelectables
-
-
-
-
Constructor Detail
-
ManyToOne
public ManyToOne(MetadataBuildingContext buildingContext, Table table)
-
-
Method Detail
-
copy
public ManyToOne copy()
-
getType
public Type getType() throws MappingException
- Throws:
MappingException
-
createUniqueKey
public void createUniqueKey(MetadataBuildingContext context)
- Specified by:
createUniqueKey
in interfaceValue
- Overrides:
createUniqueKey
in classSimpleValue
-
createPropertyRefConstraints
public void createPropertyRefConstraints(Map<String,PersistentClass> persistentClasses)
Creates a foreign key constraint in the case that the foreign key of this association does not reference the primary key of the referenced table, but instead some other unique key.We depend here on having a property of the referenced entity that does hold the referenced unique key. We might have created a "synthetic" composite property for this purpose.
-
accept
public Object accept(ValueVisitor visitor)
-
getNotFoundAction
public NotFoundAction getNotFoundAction()
-
setNotFoundAction
public void setNotFoundAction(NotFoundAction notFoundAction)
-
isIgnoreNotFound
public boolean isIgnoreNotFound()
-
setIgnoreNotFound
public void setIgnoreNotFound(boolean ignoreNotFound)
-
markAsLogicalOneToOne
public void markAsLogicalOneToOne()
-
isLogicalOneToOne
public boolean isLogicalOneToOne()
-
isNullable
public boolean isNullable()
- Specified by:
isNullable
in interfaceValue
- Overrides:
isNullable
in classSimpleValue
-
-