https://github.com/vivek-dhamanemath/hibernate-first-project
Simple Hibernate Project
https://github.com/vivek-dhamanemath/hibernate-first-project
Last synced: 3 days ago
JSON representation
Simple Hibernate Project
- Host: GitHub
- URL: https://github.com/vivek-dhamanemath/hibernate-first-project
- Owner: vivek-dhamanemath
- Created: 2025-01-03T13:55:56.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-01-09T16:51:50.000Z (6 months ago)
- Last Synced: 2025-03-24T11:14:35.277Z (3 months ago)
- Language: Java
- Size: 19.5 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Hibernate Shopping Cart
This project is a simple shopping cart application using Hibernate for ORM (Object-Relational Mapping). It allows users to add products, create users with carts, add products to carts, remove products from carts, and view all products in a cart.
## Prerequisites
- Java Development Kit (JDK) 8 or higher
- Apache Maven
- MySQL Database## Setup Instructions
1. **Clone the repository:**
```sh
git clone https://github.com/yourusername/Hibernate_Shopping_Cart.git
cd Hibernate_Shopping_Cart
```2. **Configure the database:**
- Create a MySQL database named `yourdatabase`.
- Update the database connection settings in `src/main/resources/hibernate.cfg.xml` with your MySQL username and password.3. **Build the project:**
```sh
mvn clean install
```4. **Run the application:**
```sh
mvn exec:java -Dexec.mainClass="com.hibernate.Hibernate_Shopping_Cart.App"
```## Usage
1. **Add Product:**
- Choose option `1` to add a new product.2. **Add User with Cart:**
- Choose option `2` to add a new user with an empty cart.3. **Add Product to Cart:**
- Choose option `3` to add a product to a user's cart.4. **Remove Product from Cart:**
- Choose option `4` to remove a product from a user's cart.5. **Find All Products from Cart:**
- Choose option `5` to list all products in a user's cart.6. **Exit:**
- Choose option `6` to exit the application.## Project Structure
- `src/main/java/com/hibernate/Hibernate_Shopping_Cart/`: Contains the main application code.
- `src/main/resources/`: Contains the Hibernate configuration file (`hibernate.cfg.xml`).## Dependencies
- Hibernate ORM
- MySQL Connector/J
- Apache Maven## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.