Category Archives: JPA

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