May 17 2014 by Kevin Bowersox

This morning, I revisited a stackoverflow question, I answered awhile back.  I wanted to provide a more complete answer and also saw the opportunity for a new post.  The question asked, "What's the difference between JPA and Hibernate?"

The Java Persistence Architecture API (JPA) is a Java specification for accessing, persisting, and managing data between Java objects / classes and a relational database.  Continue Reading

January 20 2014 by Kevin Bowersox

The following tutorial details how to model a self-referencing relationship using JPA.  The tutorial briefly discusses self-referencing relationships and then continues to provide a complete example of modeling the relationship in JPA.

To follow along, download the base code used for this tutorial from this GitHub repository. Source code for the completed project can be downloaded by clicking the GitHub logo below.

Continue Reading
December 08 2013 by Kevin Bowersox

The following tutorial details how to use the @Inheritance annotation in combination with the table per class strategy to map an inheritance relationship in an object model.  The tutorial discusses the differences between the table per class strategy and the single table strategy explored in the previous tutorial Inheritance with @Inheritance.  Also discussed are the limitations of the table per class strategy.


To follow along, download the base code used for this tutorial from this GitHub repository. Source code for the completed project can be downloaded by clicking the GitHub logo below.
Continue Reading

November 26 2013 by Kevin Bowersox

The following tutorial details how to use the @Inheritance annotation in JPA to map an inheritance relationship in an object model.  The tutorial discusses the capabilities provided by @Inheritance that are absent when utilizing the @MappedSuperClass annotation.  Appropriate use of both annotations is further discussed.

 

To follow along, download the base code used for this tutorial from this GitHub repository. Source code for the completed project can be downloaded by clicking the GitHub logo below.

Continue Reading
May 24 2013 by Kevin Bowersox

The following tutorial details how to use the JPA Criteria API to query against an object model. The tutorial explains how to create a simple, joined and aggregate query using the Criteria API. To follow along download the base code used for this tutorial from this Git Hub Repository. Source code for the completed project can be downloaded by clicking the GitHub logo below.

Continue Reading
Next 5 Entries