Author: Dr. YUHANG ZHAO
Introduction: In this demo, we explore how to setup and use the ORM tool Hibernate which implements JPA.
Overview: To setup Hibernate, we need:
- dependencies for Hibernate and MySQL;
- the hibernate plugin (JBoss/hibernate) in Eclipse MarketPlace;
- the configuration of MySQL in hibernate.cfg.xml. To use Hibernate, we:
- use "Session" which is an interface between the application and Hibernate;
- explore how to fetch object from and save object into DB;
- explore how to map object relations;
- use Hibernate Query Language (HQL) for complicated ORM manipulations, which differs to SQL in that HOL manipulates objects but SQL manipulates DB.
Future Work: Exploration of Hibernate caching.
System Configuration:
- Windows 7
- MySQL Workbench v8.0
- MySQL Connector 8.0.17
- Hibernate 5.4.2.Final
Reference:
- "Hibernate Tutorial | Full Course" by Telusko. https://www.youtube.com/watch?v=JR7-EdxDSf0