
Case 8 – ORM (Object Relational Mapping)
Think-Design-Write Test-Code
- Description
Since the customer for the Chat application you have been working on requested in the original requirements document that ORM (Object-Relational-Mapping) be used in the production of the application. They already have several applications written using Hibernate, a widely used ORM framework. These applications have been successful and they want to keep doing what has worked for them before.
Your boss informs you that you need to convert your Chat server to use Hibernate to persist (store) the data and do all interactions with the database.
Thankfully you wrote your application using MVC and so you can swap out the model portion without major changes anywhere else in your code.
- Concepts to Understand
- Singleton pattern
- Proxy pattern
- Using HQL
- Many-to-many relationships
- Hibernate annotations
- Relational data structure vs. object data structure
- Items you must be able to do
- Add Hibernate to a standard Eclipse Java Project
- Swap out your MVC model for a Hibernate ORM implementation
- Programatically configure a Hibernate instance
- Use simple Hibernate annotations
- Create a many-to-many relationship between tables in MySQL
- Deliverables
- UML use case diagrams for your solution
- Detailed use case diagrams for your solution
- UML state diagrams for your solution
- UML sequence diagrams for both your client and server solution
- A UML class diagram for both your client and server solutions
- A working fully functional client and server with the server using Hibernate to communicate with the database
- A presentation of your teams’ solution to the problem
- Resources
- The Singleton Pattern
- The Proxy Pattern
- The Factory Pattern
- HQL
- Many To Many definition
- Many To Many example and diagrams
- Full Hibernate annotations declaration and description
- Many-To-One and One-To-Many Relationships
- The Hibernate example database SQL file
- The Hibernate Example Java files
- The multi-use HibernateUtilSingleton.java file
- The multi-use log4j.properties file