Category Archives: JPA

Liquibase + Hibernate 5 + Envers + Spring Boot Naming Conventions

Starting with a project using Spring Boot 1.5.8 and Hibernate 5.2.12 I implemented Liquibase to handle database schema changes. This is all straight forward enough, with plenty of other tutorials of how to setup the runtime side. The schema diff … Continue reading

Posted in Gradle, java, JPA | Leave a comment

Some thoughts on a dynamic (lazy) data access layer for web services

The problem I’ve been address in my most recent work block has been to develop an interface to a relational data store which can be used either as a local DB, or via webservices. The concept is quite straight forward, … Continue reading

Posted in java, JPA, Work | 1 Comment

ManyToOne reference loading with JPA/Hibernate

In this example an InvestigationType has many SampleType’s. If I load an InvestigationType via em (entity manager) find it also loads the samples. 1. InvestigationType inv2 = (InvestigationType) em.find( 2. InvestigationType.class, inv.getId()); 3. System.out.println(“Inv2 ID=”+inv2.getId()); 4. System.out.println(“Inv2 Title=”+inv2.getTitle()); 5. assertTrue(inv2.getSample().size() … Continue reading

Posted in Archer, java, JPA | 1 Comment