Skip to content

Commit 6fdbdec

Browse files
authored
fix: adds assignment README update and fixes lombok issue (#618)
Signed-off-by: Anthony D. Mays <[email protected]>
1 parent 6f61c37 commit 6fdbdec

File tree

2 files changed

+28
-2
lines changed

2 files changed

+28
-2
lines changed

lesson_28/README.md

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,27 @@ Please review the following resources before lecture:
1313

1414
## Homework
1515

16-
- TODO(anthonydmays): Add details here
16+
- [ ] Complete [Loading the Library, Part II](#loading-the-library-part-ii) assignment.
17+
18+
19+
### Loading The Library, Part II
20+
21+
Instead of loading our library data from JSON or CSV files as we did in [lesson_10](/lesson_10/), we now want to load data from a proper database. A new implementation of the `LibraryDbDataLoader` data loader has been provided to accomplish this task and is now the [default data loader][library-app] for the app.
22+
23+
To build familiarity in working with databases, you are charged with the following tasks:
24+
25+
* Write a `.sql` script file that queries the following data. Use a unique name for your file and store it in the [queries][queries-dir] directory of the resources folder.
26+
* A `SELECT` query that returns the counts of media items by type.
27+
* A `SELECT` query that returns the sum of total pages checked out by guests.
28+
* A `SELECT` query that shows all 5 guests and any corresponding records in the `checked_out_items` table.
29+
* Add a new table called `library_users` to the [SQLite database][sqlite-db] that stores a user's id (UUID formatted string), email, first name, last name, and a password (bcrypt encoded string). Add a model and repository that loads the users into the LibraryDataModel (see `LibraryGuestModel` and `LibraryGuestRepository` as examples). Populate the database with a few users.
30+
31+
As before, you can run the app from the console using the following command:
32+
33+
```bash
34+
./gradlew run --console=plain
35+
```
36+
37+
[queries-dir]: ./db/db_app/src/main/resources/queries/
38+
[sqlite-db]: ./db/db_app/src/main/resources/sqlite/
39+
[library-app]: ./db/db_app/src/main/java/com/codedifferently/lesson28/cli/LibraryApp.java#L26

lesson_28/db/db_app/build.gradle.kts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ plugins {
55
id("com.diffplug.spotless") version "6.25.0"
66
id("org.springframework.boot") version "3.4.0"
77
id("com.adarshr.test-logger") version "4.0.0"
8-
id("io.freefair.lombok") version "8.6"
98
}
109

1110
apply(plugin = "io.spring.dependency-management")
@@ -22,6 +21,8 @@ dependencies {
2221
testImplementation("org.springframework.boot:spring-boot-starter-test")
2322
testImplementation("org.assertj:assertj-core:3.26.3")
2423
testImplementation("at.favre.lib:bcrypt:0.10.2")
24+
testCompileOnly("org.projectlombok:lombok:1.18.38")
25+
testAnnotationProcessor("org.projectlombok:lombok:1.18.38")
2526

2627
// This dependency is used by the application.
2728
implementation("com.codedifferently.instructional:instructional-lib")
@@ -36,6 +37,8 @@ dependencies {
3637
implementation("org.apache.commons:commons-csv:1.10.0")
3738
implementation("org.xerial:sqlite-jdbc:3.36.0")
3839
implementation("org.hibernate.orm:hibernate-community-dialects:6.2.7.Final")
40+
compileOnly("org.projectlombok:lombok:1.18.38")
41+
annotationProcessor("org.projectlombok:lombok:1.18.38")
3942
}
4043

4144
application {

0 commit comments

Comments
 (0)