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

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

April 27 2013 by Kevin Bowersox
 

The following tutorial details how to use JPQL to query an object model.  It explores JPQL basics and discusses the risk of SQL Injection.  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
April 12 2013 by Kevin Bowersox
 

The following tutorial details how to use JPA to persist entities that leverage an inheritance relationship using the @MappedSuperclass annotation.  It explores how the annotation is used and gives a brief overview of inheritance.  The tutorial builds off of a project created in the previous post, JPA: Ordering Collections with @OrderBy.  To follow along with this video, you can download the source code for the previous post from the GitHub Repository.  Source code for the completed project can be downloaded by clicking the GitHub logo below.

Continue Reading
April 06 2013 by Kevin Bowersox

The following tutorial details how to order a collection within an entity using the @OrderBy annotation.  It explores how the annotation is used as well as a potential issue with ordering by fields on an embedded object. The tutorial builds off of a project created in the previous post, JPA: Entity Collections.  To follow along with this video, you can download the source code for the previous post from the GitHub Repository.  Source code for the completed project can be downloaded by clicking the GitHub logo below.

Continue Reading
Next 5 Entries