Monday, January 21, 2013

Basic JPA mappings

    Sometimes, when I have to add a couple of mappings to the data model I have to spend a while to recall the correlation between JPA annotations and underlying database schema. I decided to create some kind of a cheat sheet with basic JPA mappings.

  • One-to-one unidirectional
  • One-to-one bidirectional (I) 
  • One-to-one bidirectional (II)
  • Many-to-one
  • One-to-many unidirectional
  •  One-to-many bidirectional
  • Many-to-many