/invetory-master-jpa-hibernate

A JPA and Hibernate based simple inventory management application using MySQL and Maven.

Primary LanguageJavaGNU General Public License v3.0GPL-3.0

Inventory Master using JPA and Hibernate

This is a simple inventory managment software based on Hibernate (JPA), papared by Maven. Its uses MySQL. You look at my invetory-master-JDBC repository for its JDBC version.

The project allows you to keep track of a product inventory with supplier information by loggin the invetory movements. Therefore, it includes three entities: Product, Supplier and Log. There is an one-to-many relationship between them.

In terms JPA features, the project runs queries using SQL, JPQL, NamedQueries, stored procedure, NamedStoredProcedure, as well ass Entity, Embeddable and SecondaryTable.

You can run the project using JPA (Persistence, EntityManagerFactory, EntityManager, persistance.xml) or native Hibernate (Configuration, SessionFactory,Session, hibernate.cfg.xml, hibernate.properties) using the factory BaseRepository

The project has an MVC like architecture in which CLI (view), Service (Controller) and Repository (Model) are seperated. It also applies Repository Pattern.

Before running the project, you first need to install MySQL (port: 3306) and then create the inventorymaster_jpa_db using the SQL import file given in the project folder.

For now, the project only includes command line interface.

List of Commands:

  • help
  • exit

  • list [product/supplier]
  • list morethan [QUANTITY]
  • list lessthan [QUANTITY]
  • list equals [QUANTITY]
  • list depleted

  • find [product/supplier] [NAME]
  • getindex [product/supplier] [INDEX]
  • getid [product/supplier] [ID]

  • inc_inv [ID] [QUANTITY]
  • dec_inv [ID] [QUANTITY]
  • log all/[ID]

  • update [product/supplier] [ID]
  • add [product/supplier]
  • delete [product/supplier] [ID]
  • delete_all [product/supplier] [ID]+