Class BookRepository
java.lang.Object
lt.viko.eif.jguscia.services.BookRepository
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new repository instance using the provided database initializer. -
Method Summary
-
Constructor Details
-
BookRepository
Creates a new repository instance using the provided database initializer.- Parameters:
db- service responsible for database connection management
-
-
Method Details
-
saveAll
Saves all books and their associated genres into the database.Each book is inserted into the
<code>books</code>table, and its genres are inserted into the<code>book_genres</code>table.- Parameters:
books- container object holding a list of books to persist- Throws:
SQLException- if a database access error occurs
-