Skip to content

Demonstrates idealized hibernate mappings for optimal performance and serialization.

Notifications You must be signed in to change notification settings

revelfire/mappingexample

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Hibernate Mapping for a Happy REST

See the companion article here http://revelfire.com/hibernate-mappings-performance-serialization/

Purpose

Demonstrates idealized hibernate mappings for optimal performance and serialization.

Expectations

You have a mysql database on localhost:3306 with a schema created called model_test with user root, no password. Adjust the gradle file properties to match your settings if these are not yours.

Why

This project demonstrates from very simple examples of Hibernate mappings which are designed with the following goals in mind:

  • Minimize the object graph
  • Prevent stack overflow errors on serialization
  • Prevent massive descent into the object graph on serialization
  • Model the data closely to how it gets accessed
  • Keep it simple

Some guiding principles

  • No bidirectional relationships
  • Minimize entity relationships, maximize use of keys
  • Allow services to set relationships WHEN they matter
  • Allow HQL/Repository loads and services to load relationships WHEN they matter

About

Demonstrates idealized hibernate mappings for optimal performance and serialization.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages