Many-to-One Mapping

Property Description Default

Target entity

The persistent entity to which the attribute is mapped.

You do not need to explicitly specify the target entity, since it can be inferred from the type of object being referenced.

null

Fetch

Defines how data is loaded from the database:

  • Eager – Data is loaded in before it is actually needed.

  • Lazy – Data is loaded only when required by the transaction.

Lazy

Join fetch

The type of fetch to use:

  • Inner – Provides the inner join fetching of the related object.

    Note: Inner joining does not allow for null or empty values

  • Outer – Provides the outer join fetching of the related object

    Note: Outer joining allows for null or empty values.


Optional

Specifies if this field is can be null.

True

Cascade

Specify which operations are propagated throughout the entity.

  • All – All operations

  • Persist

  • Merge

  • Move

  • Remove

  • Refresh

True


Many-to-one mappings also include the following areas: