Annotation Type ManyToMany


@Retention(CLASS) @Target(FIELD) public @interface ManyToMany
Maps entity collection membership through a join table or an inverse mappedBy field. Owning Lists store occurrences in a list_position column by default, allowing repeated links. OrderColumn can override its name; OrderBy controls load order.
  • Optional Element Summary

    Optional Elements
    Modifier and Type
    Optional Element
    Description
    Chooses operations to propagate to related entities.
    Controls relationship initialization.
    Names the owning Java relationship field on the target entity.
  • Element Details

    • fetch

      FetchType fetch
      Controls relationship initialization.
      Returns:
      fetch policy; EAGER for to-one and LAZY for collections by default
      Default:
      LAZY
    • cascade

      CascadeType[] cascade
      Chooses operations to propagate to related entities.
      Returns:
      cascade operations; empty by default
      Default:
      {}
    • mappedBy

      String mappedBy
      Names the owning Java relationship field on the target entity.
      Returns:
      owning field name, or empty for the owning side
      Default:
      ""