https://github.com/vishwajeet-29-pro/onetomany
This is a project for learning One To Many Mapping
https://github.com/vishwajeet-29-pro/onetomany
gradle java mysql-database restful-api sprign-boot spring-data-jpa
Last synced: 2 months ago
JSON representation
This is a project for learning One To Many Mapping
- Host: GitHub
- URL: https://github.com/vishwajeet-29-pro/onetomany
- Owner: Vishwajeet-29-pro
- Created: 2024-01-23T10:27:18.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-01-23T11:10:41.000Z (over 1 year ago)
- Last Synced: 2025-02-04T19:26:13.412Z (4 months ago)
- Topics: gradle, java, mysql-database, restful-api, sprign-boot, spring-data-jpa
- Language: Java
- Homepage:
- Size: 65.4 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OneToMany
This is a project for learning One To Many Mapping
# Bookstore Spring Boot ProjectThis Spring Boot project is designed for learning and understanding the concepts of One-to-Many and Many-to-One mapping in JPA, focusing on the relationship between categories and books in a bookstore application.
## Table of Contents
- [Introduction](#introduction)
- [Features](#features)
- [Technologies Used](#technologies-used)
- [Getting Started](#getting-started)
- [API Endpoints](#api-endpoints)
- [Database Configuration](#database-configuration)
- [Running the Application](#build-and-run-the-application)
- [Contributing](#contributing)## Introduction
The primary goal of this project is to provide a practical understanding of One-to-Many and Many-to-One mapping in Spring Boot, specifically demonstrating the association between categories and books in a bookstore management system.
## Features
- **Category Management:**
- Create, read, update, and delete category details.
- Retrieve all categories.
- Retrieve category by ID or name.
- Update category by ID or name.
- Delete category by ID or name.- **Book Management:**
- Create, read, update, and delete book details.
- Retrieve all books.
- Retrieve book by ID or title.
- Update book by ID or title.
- Delete book by ID or title.## Technologies Used
- Spring Boot
- Spring Data JPA
- RESTful API
- MySQL Database
- Gradle## Getting Started
1. **Clone the Repository:**
```bash
git clone https://github.com/your-username/your-repository.git## Database Configuration:
Configure your MySQL database settings in the src/main/resources/application.properties file.
## Build and Run the Application:
```bash
cd your-repository
./gradlew bootRun
```## Access the API:
The application will be accessible at http://localhost:8080.## API Endpoints:
**Category Controller**Create Category:
POST /api/1.0/category/Get All Categories:
GET /api/1.0/category/getallGet Category by ID:
GET /api/1.0/category/id/{id}Get Category by Name:
GET /api/1.0/category/{name}Update Category by ID:
PUT /api/1.0/category/updateById/{id}Update Category by Name:
PUT /api/1.0/category/updateCategoryByName/{name}Delete Category by ID:
DELETE /api/1.0/category/deleteById/{id}Delete Category by Name:
DELETE /api/1.0/category/deleteCategoryByName/{name}**Book Controller**
Create Book:
POST /api/1.0/books/Get All Books:
GET /api/1.0/books/Get Book by ID:
GET /api/1.0/books/id/{id}Get Book by Title:
GET /api/1.0/books/{title}Update Book by ID:
PUT /api/1.0/books/updateById/{id}Update Book by Title:
PUT /api/1.0/books/updateBookByTitle/{title}Delete Book by ID:
DELETE /api/1.0/books/deleteById/{id}Delete Book by Title:
DELETE /api/1.0/books/deleteBookByTitle/{title}**Running the Application:**
To run the application, execute the main method in the BookstoreApplication class.## Contributing:
Feel free to contribute to the project by opening issues or submitting pull requests. Any feedback or suggestions are welcome!