This project is a simple library management system handling books, authors, categories, publishers, and borrowing operations. It uses JPA (Hibernate) and runs on PostgreSQL.
- Purpose and scope
- Project requirements
- Setup and run
- Database schema and tables
- Sample data
- Screenshots
- Entities:
book,author,category,publisher,book_borrowingand their relations. - Relations:
- Author (One) ↔ Book (Many)
- Publisher (One) ↔ Book (Many)
- Category (Many) ↔ Book (Many) — join table:
category_book - Book (One) ↔ BookBorrowing (Many)
- Java 21
- Maven
- PostgreSQL 14+
- Create the PostgreSQL database:
CREATE DATABASE library_management_system;- Update connection properties in
src/main/resources/META-INF/persistence.xml:
- URL:
jdbc:postgresql://localhost:5432/library_management_system - Username:
postgres - Password:
your password
- Maven dependencies
- Dependencies already exist in
pom.xml
- Entity package mapping
- In Hibernate 6.5 and later, entity classes must be explicitly declared in the
persistence.xmlfile.
- Schema generation strategy
- For development:
hibernate.hbm2ddl.auto = create - Alternatively:
update
Expected tables:
authorpublisherbookcategorybook_borrowingcategory_book(join table)
Relation notes:
book.author_id→author.author_id(ManyToOne)book.publisher_id→publisher.publisher_id(ManyToOne)category_bookconnectsbookandcategory(ManyToMany)book_borrowing.book_id→book.book_id(ManyToOne)
When LibraryManagementSystemMain runs, it inserts sample data. book_borrowing.returnDate is null initially; set it on return.
Bu proje, kitap, yazar, kategori, yayınevi ve ödünç alma süreçlerini yöneten basit bir kütüphane yönetim sistemidir. JPA (Hibernate) ile PostgreSQL üzerinde çalışır.
- Amaç ve kapsam
- Proje gereksinimleri
- Kurulum ve çalıştırma
- Veritabanı şema ve tablolar
- Test için örnek veriler
- Ekran görüntüleri
- Kitap (
book), Yazar (author), Kategori (category), Yayınevi (publisher), Ödünç Alma (book_borrowing) tablolarını ve ilişkilerini içerir. - İlişkiler:
- Yazar (One) ↔ Kitap (Many)
- Yayınevi (One) ↔ Kitap (Many)
- Kategori (Many) ↔ Kitap (Many) — join tablo:
category_book - Kitap (One) ↔ Ödünç Alma (Many)
- Java 21
- Maven
- PostgreSQL 14+
- PostgreSQL veritabanını oluşturun:
CREATE DATABASE library_management_system;src/main/resources/META-INF/persistence.xmliçinde bağlantı bilgilerini kendi ortamınıza göre güncelleyin:
- URL:
jdbc:postgresql://localhost:5432/library_management_system - Kullanıcı adı:
postgres - Şifre:
şifreniz
- Maven bağımlılıkları
pom.xmliçerisinde bağımlılıklar zaten mevcut.
- Entity sınıfları paketi
- Hibernate 6.5 ve sonrasında,
persistence.xmldosyasında entity sınıflarının açıkça belirtilmesi gerekmektedir.
- Şema oluşturma stratejisi
- Geliştirme için:
hibernate.hbm2ddl.auto = create - Alternatif:
update
Oluşması beklenen tablolar:
authorpublisherbookcategorybook_borrowingcategory_book(ManyToMany join tablosu)
İlişki notları:
book.author_id→author.author_id(ManyToOne)book.publisher_id→publisher.publisher_id(ManyToOne)category_bookjoin tablosu ilebookvecategoryarasında ManyToManybook_borrowing.book_id→book.book_id(ManyToOne)
LibraryManagementSystemMain çalıştığında örnek veri eklenir. book_borrowing.returnDate alanı ilk eklemede null bırakılır; iade edildiğinde tarih güncelleyebilirsiniz.