commit 448bacdd8e2dfc26ac100f1d53ed2968619cfdc9
parent 6ce819df070e8d1ed5d5f8db9b27d752f80b57db
Author: WimDupont <WimDupont@users.noreply.gitlab.com>
Date: Fri, 13 Aug 2021 12:08:15 +0200
book update
Diffstat:
2 files changed, 9 insertions(+), 5 deletions(-)
diff --git a/src/main/java/com/wimdupont/personalweb/controller/BookController.java b/src/main/java/com/wimdupont/personalweb/controller/BookController.java
@@ -25,12 +25,12 @@ public class BookController {
@SuppressWarnings("unused")
public String getBooks(Model model) {
List<BookDto> bookDtoList = bookService.findAll().stream().map(bookToBookDtoConverter::convert).collect(Collectors.toList());
- bookDtoList = bookDtoList.stream().sorted(Comparator.nullsFirst(Comparator.comparing(BookDto::getCategory)
+ bookDtoList = bookDtoList.stream().sorted(Comparator.comparing(BookDto::getCategory)
.thenComparing(BookDto::getAuthor)
.thenComparing(BookDto::getSeries, Comparator.nullsFirst(Comparator.naturalOrder()))
.thenComparing(BookDto::getSeriesNumber, Comparator.nullsFirst(Comparator.naturalOrder()))
.thenComparing(BookDto::getTitle)
- )).collect(Collectors.toList());
+ ).collect(Collectors.toList());
model.addAttribute("books", bookDtoList);
return "books";
diff --git a/src/main/resources/db/migration/repeatable/R__fill_book_table.sql b/src/main/resources/db/migration/repeatable/R__fill_book_table.sql
@@ -8,6 +8,7 @@ INSERT INTO book VALUES
(UUID(), "Head First Design Patterns, 2nd Edition", "Eric Freeman, Elisabeth Robson", "9781492078005", "Programming: Java", null, null),
(UUID(), "Java Generics", "Maurice Naftalin, Philip Wadler", "9780596527754", "Programming: Java", null, null),
(UUID(), "Java How to Program, Seventh Edition", "Harvey M. Deitel, Paul J. Deitel", "9780132222204", "Programming: Java", null, null),
+ (UUID(), "The C Programming Language, 2nd Edition ", "Brian Wilson Kernighan, Dennis MacAlistair Ritchie", "9780131103627", "Programming: C", null, null),
(UUID(), "Computer Networking: A Top-Down Approach, Seventh Edition", "James Kurose, Keith Ross", "9781292153599", "IT", null, null),
@@ -39,9 +40,12 @@ INSERT INTO book VALUES
(UUID(), "The Name of the Wind (The Kingkiller Chronicle: Day 1)", "Patrick Rothfuss", "9780575081406", "Fantasy", "The Kingkiller Chronicle", 1),
(UUID(), "The Wise Mans Fear (The Kingkiller Chronicle: Day 2)", "Patrick Rothfuss", "9780575081437", "Fantasy", "The Kingkiller Chronicle", 2),
(UUID(), "The Hobbit", "J.R.R. Tolkien", "9780544445796", "Fantasy", null, null),
- (UUID(), "The Fellowship of the Ring (The Lord of the Rings: #1)", "J.R.R. Tolkien", "9780544448933", "Fantasy", "The Lord of the Rings", 1),
- (UUID(), "The Two Towers (The Lord of the Rings: #2)", "J.R.R. Tolkien", "9780544449732", "Fantasy", "The Lord of the Rings", 2),
- (UUID(), "The Return of the King (The Lord of the Rings: #3)", "J.R.R. Tolkien", "9780544449749", "Fantasy", "The Lord of the Rings", 3),
+ (UUID(), "The Fellowship of the Ring (The Lord of the Rings #1)", "J.R.R. Tolkien", "9780544448933", "Fantasy", "The Lord of the Rings", 1),
+ (UUID(), "The Two Towers (The Lord of the Rings #2)", "J.R.R. Tolkien", "9780544449732", "Fantasy", "The Lord of the Rings", 2),
+ (UUID(), "The Return of the King (The Lord of the Rings #3)", "J.R.R. Tolkien", "9780544449749", "Fantasy", "The Lord of the Rings", 3),
+ (UUID(), "Stardust", "Neil Gaiman", "9780755322824", "Fantasy", null, null),
+ (UUID(), "Good omens", "Terry Pratchett, Neil Gaiman", "9781473200852", "Fantasy", null, null),
+ (UUID(), "Books of Earthsea", "Ursula K. Le Guin", "9781473223547", "Fantasy", "The Earthsea Cycle", null),
(UUID(), "To Kill A Mockingbird", "Harper Lee", "9780099549482", "Fiction", null, null),
(UUID(), "The Midnight Library", "Matt Haig", "9781786892720", "Fiction", null, null),