Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 3cd0505

Browse files
author
Rajeev Kumar Singh
committed
Added Fetch and Cascade Type
1 parent 81654b2 commit 3cd0505

File tree

1 file changed

+1
-1
lines changed
  • hibernate-many-to-many-demo/src/main/java/com/example/hibernatemanytomanydemo/model

1 file changed

+1
-1
lines changed

‎hibernate-many-to-many-demo/src/main/java/com/example/hibernatemanytomanydemo/model/Student.java‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ public class Student {
2727
@Size(max = 100)
2828
private String email;
2929

30-
@ManyToMany
30+
@ManyToMany(fetch = FetchType.LAZY, cascade = CascadeType.ALL)
3131
@JoinTable(name = "enrolments",
3232
joinColumns = { @JoinColumn(name = "student_id") },
3333
inverseJoinColumns = { @JoinColumn(name = "course_id") })

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /