开发者

Is this a bidirectional one-to-many relationship?

Is this a bidirectional one-to-many relationship?

Booking class:

@OneToMany(cascade=(Casca开发者_JAVA百科deType.ALL), fetch=FetchType.EAGER, mappedBy = "customer")
private List<Booking> bookings = new ArrayList<Booking>();

Customer class:

@ManyToOne(cascade={CascadeType.ALL}, fetch=FetchType.EAGER)
@JoinColumn(name = "custNo", referencedColumnName = "customerNo")
private Customer customer;


Bidirectional means that both entities refer to each other. So yes it is a bidirectional relationship.

For more information on One-to-Many and Many-to-One relationship please refer to JPA 2.0 Spec (Section 2.10.2).

http://jcp.org/aboutJava/communityprocess/final/jsr317/index.html

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜