@ManyToOne: Difference between revisions
Jump to navigation
Jump to search
No edit summary |
|||
Line 14: | Line 14: | ||
private User user; | private User user; | ||
} | } | ||
</ | </syntaxhighlight> |
Latest revision as of 02:07, 18 November 2018
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;
}