File tree Expand file tree Collapse file tree 3 files changed +7
-7
lines changed
HibernateSpringBootLoadBatchAssociation/src/main/java/com/bookstore Expand file tree Collapse file tree 3 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -20,8 +20,8 @@ public static void main(String[] args) {
2020 @ Bean
2121 public ApplicationRunner init () {
2222 return args -> {
23- // System.out.println("\n\nLoad authors with books:");
24- // bookstoreService.displayAuthorsAndBooks();
23+ System .out .println ("\n \n Load authors with books:" );
24+ bookstoreService .displayAuthorsAndBooks ();
2525
2626 System .out .println ("\n \n Load books with authors:" );
2727 bookstoreService .displayBooksAndAuthors ();
Original file line number Diff line number Diff line change @@ -28,7 +28,7 @@ public class Author implements Serializable {
2828
2929 @ OneToMany (cascade = CascadeType .ALL ,
3030 mappedBy = "author" , orphanRemoval = true )
31- // @BatchSize(size = 3)
31+ @ BatchSize (size = 3 )
3232 private List <Book > books = new ArrayList <>();
3333
3434 public void addBook (Book book ) {
Original file line number Diff line number Diff line change @@ -59,15 +59,15 @@ public void setAuthor(Author author) {
5959
6060 @ Override
6161 public boolean equals (Object obj ) {
62-
62+
6363 if (this == obj ) {
6464 return true ;
6565 }
66-
66+
6767 if (getClass () != obj .getClass ()) {
6868 return false ;
6969 }
70-
70+
7171 return id != null && id .equals (((Book ) obj ).id );
7272 }
7373
@@ -80,5 +80,5 @@ public int hashCode() {
8080 public String toString () {
8181 return "Book{" + "id=" + id + ", title=" + title + ", isbn=" + isbn + '}' ;
8282 }
83-
83+
8484}
You can’t perform that action at this time.
0 commit comments