@ManyToOne

From NovaOrdis Knowledge Base
Revision as of 02:07, 18 November 2018 by Ovidiu (talk | contribs) (→‎Overview)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Internal

Overview

The @ManyToOne annotation in the example below indicates that the Order belongs to one and only one User, but a User can have many Orders.

@Entity
public class Order {
  ...
  @ManyToOne
  private User user;
}